Programming in "C‟ | Define following terms: (i) Keyword (ii) Token

(i) Keyword: Keyword is pre-defined or reserved word in a programming language. These cannot be used as identifiers in the program.

(ii) Token: A token is the smallest element of a program that is meaningful to the compiler. 

---------------------------------------------------------

Give syntax for switch case statement.

switch(variable) 
{
      case value1:
      statements
      break;
      case value2:
statements;
      break;
      default:
      statements;
      break;

-----------------------------------------------------------
Give output for following code:

# include <stdio.h>
main( )
{
   int a = 5, b = 6, *ptr1, *ptr2;
   ptr1 = &b;
   ptrt2 = &a;
   printf(“%d%d”, *ptr1, *ptr2);
}

Output: 65 

----------------------------------------------------------
List any four relational operators in „C‟.
Relational operators:
==      equal to
!=       Non equal to
 <       less than 
 >       Greater than   
<=      Less than equal to
>=      Greater than equal to 

---------------------------------------------------------

Post a Comment

0 Comments