0
void main()
{
int x;
printf(âEnter week number :â);
scanf(â%dâ,&x);
if(x==0)
printf(âSundayâ);
else if(x==1)
printf(âMondayâ);
else if(x==2)
printf(âTuesdayâ);
else if(x==3)
printf(âWednesdayâ);
else if(x==4)
printf(âThursdayâ);
else if(x==5)
printf(âFridayâ);
else if(x==6)
printf(âSaturdayâ);
else
printf(âNo dayâ);
}
Explaining
The above program is working based on ladder if
Every âifâ is a condition
Stating from 0 to 6 valid input and valid days
Finally âelseâ represents if none of the conditions are satisfying
Means more than 6 or less than 0 no day is available