Thursday 16 January 2014

Explain comma operator with example.

It is used to separate 2 or more expressions.
It has lowest priority among all operators.

Write a program to show comma operator

#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
printf("Addition =%d \n Subtraction=5d",3+2,3-2);
}
output
Addition=5
Subtraction=1


No comments:

Post a Comment