C Program to demonstrate conditional operator

//C Program to demonstrate conditional operator:-

#include <stdio.h>
#include<conio.h>
void main()
{
   int mark;
   clrscr();
   printf("Enter mark: ");
   scanf("%d", &mark);
   printf(mark >= 35 ? "Passed" : "Failed");
   getch();
}

============

Output:-

Enter mark: 89
Passed                                                    

============

C Program to demonstrate conditional operator

Comments