Write a program to read three numbers from the keyboard and find the maximum out of these three numbers. (nested if-else)
if else program You can get more c related programs and more here http://projugaadu.com/category/topics/c-language/
pps programs
if else program You can get more c related programs and more here http://projugaadu.com/category/topics/c-language/
#include<stdio.h> int main() { int marks; printf(“\n Enter Marks from 0-70 :”); scanf(“%d”,&marks); if(marks<23) { printf(“\n Sorry ..! You are Fail”); } else { printf(“\nCongratulation …! You are Pass”); } return 0; }
#include<stdio.h> int main() { int no; printf(“\n Enter any number : “); scanf(“%d”,&no); if(no==0) { printf(“\n Entered Number is Zero”); } else if(no>0) { printf(“\n Entered Number is Positive”); } else { printf(“\n Entered Number is Negative”); } return 0; }
#include<stdio.h> int main() { float u,a,d; int t; printf(“\nEnter the value of a : “); scanf(“%f”,&a); printf(“\nEnter the value of u : “); scanf(“%f”,&u); printf(“\nEnter the value of t : “); scanf(“%d”,&t); d = (u … Read more
centigrade to Fahrenheit formula (f=1.8*c +32) #include <stdio.h> int main() { float F,C; printf(“Enter Temperature in Celsius : ” ); scanf(“%f”,&C); F = (C * 1.8) + 32; printf(“\n %.2f Celsius = %.2f Fahrenheit”,C, F); return 0; } More C programs are here http://projugaadu.com/category/topics/c-language/
//kilometers to meter#include <stdio.h> int main() { float km; printf(“Enter Length in KiloMeter : “); scanf(“%f”,&km); printf(“\n %.2f KM = %.2f Meters”,km,km*1000); printf(“\n %.2f KM = %.2f Feets”,km,km*3280.84); printf(“\n %.2f KM = %.2f Inches”,km,km*39370.08); printf(“\n %.2f KM = %.2f Centimeters”,km,km*1000*100); return 0; } you can find more c programs and things here http://projugaadu.com/category/topics/c-language/
//swap two numbers#include <stdio.h> int main() { int a,b; printf(“Enter Value of a :”); scanf(“%d”,&a); printf(“Enter Value of b :”); scanf(“%d”,&b); a=a+b; b=a-b; a=a-b; printf(“\nAfter Swapping Values a = %d b = %d”,a,b); return 0; } You can get more c program here http://projugaadu.com/category/topics/c-language/
#include<stdio.h> int main() { int i,j; printf(“\n Enter 1st Integer Value :”); scanf(“%d”,&i); printf(“\n Enter 2nd Integer Value :”); scanf(“%d”,&j); printf(“\n addition : %d”,i+j); printf(“\n multiplication : %d”,i*j); printf(“\n division : %d”,i/j); printf(“\n subtraction : %d”,i-j); return 0; }
// how to find area of triangles #include<stdio.h>int main(){float a,h,b;printf(“\n Enter height :”);scanf(“%f”,&h);printf(“\n Enter base :”);scanf(“%f”,&b);a=b*h*0.5;printf(“\n Area of triangle = %f”,a);return 0;} You can get more related c programs here http://projugaadu.com/category/topics/c-language/
#include <stdio.h> int main() { int n; float p, r, I; printf(“\n Enter Amount p :”); scanf(“%f”,&p); printf(“\n Enter Rate r :”); scanf(“%f”,&r); printf(“\n Enter No of Years n :”); scanf(“%d”,&n); I = (p*r*n)/100; printf(“\n Interest = %.2f”,I); return 0; }