Wisdom Materials
Home
About Us
Our Clients
Careers
Services
Education
Jobs
News
Business
Health
Astrology
Entertainment
RealEstate
Devotion
Contact Us
C Programs
/ conditional operator C program
Program Name
Write a C Program for conditional operator C program.
Theory
conditional operator is used to execute a particular statements(block) based on the condition. condition?block1:block2; If condition==true block1 is executed otherwise block2 is executed.
Program Code
Copy Program Code
#include
int main() { int n1,n2; printf("Enter two Numbers: "); scanf("%d%d",&n1,&n2); (n1>n2)?printf("n1= %d is big",n1):printf("n2= %d is big",n2); }
Input
Enter two Numbers:5 4
Output
n1= 5 is big
Online C Compiler (To copy paste and Run the c program)
Home
Back