Finding Identifiers and Literals – CSKC
Sign In

Search

Solved Problem #CPP#1778    siteicon   siteicon  

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

×

Ask AI About This Code

Default Prompt that is passed along with the code is given below, You can write your own prompt if you so desire.



×

Test CPP

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()

 


Share

Created: 18-Dec-2017 20:51 | Updated: 1-Jan-2019 17:31|