Example(s):Palindrome, prime, armstrong, "linear search", reverse etc.
Example(s):1575, 1632, 1539 (Only one at a time)
Login
[lwa]
Solved Problem
#CPP#1778
Problem Statement - Finding Identifiers and Literals
Write down identifiers and literals in the code given here.
int main()
{
int a=5;
cout<<"a="<<a<<endl;
float b=3.5;
double c=4.56;
cout<<"b="<<b<<endl;
cout<<"c="<<c<<endl;
cout<<"Sum of a+b+c = "<<a+b+c<<endl;
return 0;
}
Solution
TC++ #1778
Identifiers:
std //this identifier is their in c++ library, it is not a keyword
main //this identifier is default function name from where to begin
a //programmer given identifier
b //programmer given identifier
c //programmer given identifier
cout //this is an object identifier given in iostream.h, this is not a C++ keyword
endl //this is an object identifier given in iostream.h, this is not a C++ keyword
Literals: 5 //Integer literal
“a=” //String literal
3.5 //fraction literal
4.56 //fraction literal
“b=” //String literal
“c=” //String literal
Sum of a+b+c = //String literal
0 //integer literal used as returned value from main()