0% found this document useful (0 votes)
2 views

C program

The document contains C code snippets for three different programs. The first program checks if a character is uppercase, lowercase, or not an alphabet. The second program performs basic arithmetic operations based on user input, and the third program prints the day of the week based on a number input from the user.

Uploaded by

mariakhan200131
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

C program

The document contains C code snippets for three different programs. The first program checks if a character is uppercase, lowercase, or not an alphabet. The second program performs basic arithmetic operations based on user input, and the third program prints the day of the week based on a number input from the user.

Uploaded by

mariakhan200131
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include<stdio.

h>
#include<conio.h>
int main()
{
char ch;
printf("Enter any character :");
scanf("%c", &ch);
if(ch>='A' &&ch<='Z')
{
printf("'%c'Upper case ",ch);
}
else if(ch>='a' &&ch<='z')
{
printf("'%c'Lower case",ch);
}
else
{
printf("'%c'is not an alphabet ",ch);

}
getch();
return 0;
}
**************************************************************
int a,b,c;
char ch;
printf("Enter the operator \n + addition \n - subtraction \n * Multipluction
\n / division \n % reminder ");
scanf("%c",ch);
if(ch=='+')
{
printf('Addition \n');
c=a+b;
printf('sum-%d',c);
}
else
if(ch=='-')
{
printf("subtruction");
c=a-b;
printf("Difference =%d",c);
}
else
if(ch=='*')
{
printf("Multiplication \n");
c=a*b;
printf("product=%d",c);
}
else
if(ch=='/')
{
printf("Division \n");
c=a/b;
printf("Divide=%d",c);
}
*******************************************************************
#include<stdio.h>
#include<conio.h>
int main()
{
int day;
printf("Enter the day ");
scanf("%d",&day);
if(day==0)
printf("\n Monday");
if(day==1)
printf("\n Tuesday");
if(day==2)
printf("\n Wednesday");
if(day==3)
printf("\n Thursday");
if(day==4)
printf("\n Friday ");
if(day==5)
printf("\n Saturday");
if(day==6)
printf("\n Sunday");
//else
//{

//printf("\n Invaild Number !");

//}
getch();
return 0;
}

You might also like