jituTechnology

jituTechnology

Read an integer value. Assume it is the number of a month of the year; print out the name of that month

Here is the c source code for: Read an integer value. Assume it is the number of a month of the year; print out the name of that month

/* a program to enter the number , assume it the monthe of the year and print the corresponding month
programmed by :
Name: Jitendra Yadav  */
#include <stdio.h>
#include <conio.h>
void main()
{
     int a;
   printf(“Enter the number from 1 to 12 “);
   scanf(“%d”,&a);
   if (a==1)
   {
     printf(“This is janauary”);
   }
   else if(a==2)
   {
     printf(“The month is febuary”);
   }
   else if(a==3)
   {
     printf(“The month is March”);
   }
   else if(a==4)
   {
     printf(“The month is April”);
   }
   else if(a==5)
   {
     printf(“The month is May”);
   }
   else if(a==6)
   {
     printf(“The month is June”);
   }
   else if(a==7)
   {
     printf(“The month is July”);
   }
   else if(a==8)
   {
     printf(“The month is August”);
   }
   else if(a==9)
   {
     printf(“The month is September”);
   }
   else if(a==10)
   {
     printf(“The month is October”);
   }
    else if(a==11)
   {
     printf(“The month is November”);
   }
   else if(a==12)
   {
     printf(“The month is December”);
   }
   else
   {
     printf(“This is not valid” );
   }
   getch();
}

 

No comments yet.

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

April 2026
S M T W T F S
 1234
567891011
12131415161718
19202122232425
2627282930