Wisdom Materials
Home
About Us
Our Clients
Careers
Services
Education
Jobs
News
Business
Health
Astrology
Entertainment
RealEstate
Devotion
Contact Us
C Programs
/ if else if statement C program
Program Name
Write a C Program for if else if statement C program.
Theory
if else if statement in C language is a desicion making statement.
Program Code
Copy Program Code
#include
void main() { int day; printf("Enter a day value(1-7)\n"); scanf("%d",&day); if(day==1) printf("%d is sunday",day); else if(day==2) printf("%d is monday",day); else if(day==3) printf("%d is tuesday",day); else if(day==4) printf("%d is Wednusday",day); else if(day==5) printf("%d is Thursday",day); else if(day==6) printf("%d is Friday",day); else if(day==7) printf("%d is Saturday",day); else printf("Please enter 1 to 7 only"); }
Input
Enter a day value(1-7) 4
Output
4 is Wednusday
Online C Compiler (To copy paste and Run the c program)
Home
Back