Easy C Programming Problems & Solution For Beginners
Easy C Programming Problems & Solution For Beginners
C programming
Simple problems for beginners
Contents:
1. Find the average of any three numbers. 2. Find the bigger number of any two numbers. 3. Find the biggest number of any three numbers. 4. Find if the number is positive or negative. 5. Find if the number is odd or even. 6. Find grade (BUBT grading system). 7. Calculate summation of the series : 1+2+3+4+.+n 8. Calculate factorial of n! . 9. Convert Celsius temperature to Fahrenheit. 10. Convert Fahrenheit temperature to Celsius.
#include<stdio.h> int main() { int a,b,c,avg; printf(Input first number:); scanf(%d,&a); printf(Input second number:); scanf(%d,&b); printf(Input third number:); scanf(%d,&c);
#include<stdio.h>
int main() { int a,b; printf(Input first number:); scanf(%d,&a); printf(Input second number:); scanf(%d,&b);
return 0; }
{ int a,b,c; printf(Input first number:); scanf(%d,&a); printf(Input second number:); scanf(%d,&b); printf(Input third number:); scanf(%d,&c);
if((a>b) && (a>c)) printf(%d is biggest number.,a); else if((b>a) && (b>c)) printf(%d is biggest number.,b); else printf(%d is biggest number.,c);
return 0; }
return 0; }
Problem#5: Find if the number is odd or even. #include<stdio.h> int main() { int a;
else if(a>=75) printf(Grade= A); else if(a>=70) printf(Grade= A-); else if(a>=65) printf(Grade= B+); else if(a>=60) printf(Grade= B); else if(a>=55) printf(Grade= B-); else if(a>=50) printf(Grade= C+); else if(a>=45) printf(Grade= C); else if(a>=40) printf(Grade= D); else if(a<40) printf(Grade= F);
return 0; }
for( i=0 ; i<=n , i++ ) { sum=sum+1; } Printf(Summation of the series: 1+2+3+4+.+%d is %d,n,sum); return 0; }
return 0; }
return 0; }