Post Page Advertisement [Top]

C-Programming

Write a program in c to display month name by number ?


Home / C-Programming / Write a program in c to display month name by number ?
Write a program in c to display month name by number
 in 
 Write a program in c to display month name by number ?

  • introduction of c-programming language.
The ‘C’ programming language was developed in 1917 at Bell Laboratories by a system programmer named Dennis Ritchie.This C-language derived its name from the fact that it is based on a language developed by Ken Thompson, and other system programmer at Bell laboratory.


Code:-
#include<stdio.h>
#include<conio.h>
void main()
{int m;
clrscr();
printf("\n enter the month number");
scanf("%d",&m);
switch(m){case 1: printf("\n january");                break;
case 2: printf("\n february");
                break;case 3: printf("\n march");
               break;
case 4: printf("\n april");
                break;
case 5: printf("\n may");
                break;
case 6: printf("\n june"); 
               break;
case 7: printf("\n july");
                break;
case 8: printf("\n august");
                break;
case 9: printf("\n september"); 
               break;
case 10: printf("\n october");
                break;
case 11: printf("\n november");
                break;
case 12: printf("\n december");
                break;
}
getch();
}






Dizit Operators
Thank-you

No comments:

Post a Comment

Bottom Ad [Post Page]