Tuesday, 25 August 2020

HOW TO FIND DATE USING C PROGRAM?

THE FOLLOWING PROGRAM IS USED TO  FIND DATE USING A PROGRAM IN C?

PROBABLY WE CAN USED SWITCH STATEMENT FOR THIS PROGRAM. THE BELOW PROGRAM I HAVE USED SWITCH STATEMENT.

#include<stdio.h>
#include<conio.h>
void main()
{
int no;
clrscr();
printf("Print the day\n");
scanf("%d",&no);
switch(no)
{
case 1:
printf("Monday");
break;
case 2:
printf("Tuesday");
break;
case 3:
printf("Wednesday");
break;
case 4:
printf("Thursday");
break;
case 5:
printf("Friday");
break;
case 6:
printf("Saturday");
break;
case 7:
printf("Sunday");
break;
default:
printf("Invalid input");
}
getch();
}

THIS PROGRAM IS VERY SIMPLE FOR THE PROGRAMMERS WHO KNOWS ABOUT SWITCH STATEMENT.
SO BEFORE CODING THIS PROGRAM WE HAVE TO KNOW ABOUT SWITCH STATEMENT.

No comments:

Post a Comment

C Programming

What is DBMS in brief?

A Database Management System (DBMS) is a software suite designed to efficiently manage, organize, store, manipulate, and retrieve data. It a...