Standard Identifiers and Comments

(a) Describe the standard identifiers. Also give examples.

A type of identifier that has special meaning in C is known as standard identifiers. C cannot use a standard identifier for its original purpose if it is redefined. printf and scanf are examples of standard identifiers. These are the names of input/output library stdio.h.

(b) What are comments in a C language program? Why are they used? Describe its types.

Comments are the lines of program that are not executed. The compiler ignores comments and does not include them in executable program. That is why the comments do not affect the size of executable program. Comments are used to increase the readability of the program. Comments are notes about different lines of code that explain the purpose of the code. The user can insert information notes in the code.

There are two types of comments :

  1. Single-line Comments: Comments on single line are added by using double slash “/ /”.
  2. Multi-line Comments: Multi-line comments are inserted to the code by using /* at the beginning of comments and */ at the end of multi-line comments.

(c) What is the output of the following program code?

void main()
{
int n,a,b;
n=400;
a=n%100;
b=n/10;
n=n%10;
printf(“%d %d %d”,n++,++b,++a);
getch();
}

Ans. Output: 0 41 1