Subscribe For Free Updates!

We'll not spam mate! We promise.

Sunday 26 August 2012

C++ code to display days of week using if statement



//Displyaing days of week
//Programmer name: Sohail ahmed
//Date: 10-03-2010

#include<iostream.h>
#include<conio.h>

int main()
{
clrscr();
int num_1;

cout<<"\t---Displaying days of the week---\n\n\n";
cout<<"Enter integer value between (0&6): ";
cin>>num_1;

if(num_1==0)
cout<<"\nMonday";
else if(num_1==1)
cout<<"\nTuesday";
else if(num_1==2)
cout<<"\nWednesday";
else if(num_1==3)
cout<<"\nThrusday";
else if(num_1==4)
cout<<"\nFriday";
else if(num_1==5)
cout<<"\nSaturday";
else if(num_1==6)
cout<<"\nSunday";
else
cout<<"\nInvlid option!";
getch();
return 0;
}

Socializer Widget By CodingLovers
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment