Monday, 23 February 2015

Conditional Operator in C


#include<stdio.h>
#include<conio.h>
main()
{
int a=-4;
clrscr();
printf("\n A Is      :%s",(a>0?"Positive":"Negative"));
printf("\n A Is      :%s",(a%2==0)?"Even":"Odd");
getch();
}

No comments:

Post a Comment