Professional Documents
Culture Documents
ID : C-201234
DEPERTMENT OF CSE
CSE-1122
Solution :
#include <stdio.h>
int main() {
return 0;
}
Problem no. 02 : Write a C program to check whether the
triangle is equilateral,isosceles,or scalene .
Solution :
#include<stdio.h>
int main(){
int side1,side2,side3;
scanf("%d %d %d",&side1,&side2,&side3);
if(side1==side2&&side2==side3)
else if(side1==side2||side1==side3||side2==side3)
else
return 0;
}
Problem no. 03 : Write a C program to check a number
whether it is divisible by 5 and 11 or not .
Solution :
#include <stdio.h>
int main()
int num;
scanf("%d", &num);
else
return 0;
}
Problem no. 04 : Write a C program to check whether it is a
leap year or not .
Solution :
#include<stdio.h>
int main(){
int year;
scanf("%d",&year);
if(year%4==0)
if(year%100==0)
if(year%400==0)
else
else
printf("%d is a leap year . ");
else
return 0;
}
Problem no. 05 : Write a C program to input any alphabet and
check whether it is vowel or alphabet.
Solution :
#include <stdio.h>
int main()
char ch;
printf("Enter a character\n");
scanf("%c", &ch);
else
return 0;
}
Problem no. 06 : Write a C program to input any alphabet and
check whether it is uppercase or lowercase .
Solution :
#include<stdio.h>
int main(){
char ch;
scanf("%c",&ch);
return 0;
}
Problem no. 07 : Write a C program to input a character and
check whether it is an alphabet ,digit or special character .
Solution :
int main(){
char ch;
scanf("%c",&ch);
printf("%c IS AN ALPHABET\n",ch);
else
return 0;
}
Problem no. 08 : Write a C program to find
maximum,minimum,middle from three numbers.
Solution :
#include<stdio.h>
int main()
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a>b)
if(a>c)
if(c>b)
else
else
else
if(b>c)
if(c>a)
else
else
return 0;
}
Problem no. 09 : Write a C program to input marks of five
subjects and calculate percentage and grade .
Solution :
#include<stdio.h>
int main(){
int physics,chemistry,biology,math,computer,total,average;
scanf("%d%d%d%d%d",&physics,&chemistry,&biology,&math,&computer);
total=physics+chemistry+biology+math+computer;
average=total/5;
if(average>=90)
else if(average>=80)
else if(average>=70)
else if(average>=40)
else if(average<=40)
else
return 0;