If else

Rounding Of Number In C

Q. How to make program  of Rounding Number in C ? #include<stdio.h> #include<conio.h> void main () { float num; int x; clrscr(); printf(“Enter your Number”); scanf(“%f”,&num); if(num<0) x=(num-0.5); else x=(num + 0.5); printf(“%d”,x); getch(); } After Running Program 🙂

Reverse Number By Using C

#include<stdio.h> #include<conio.h> void main () { int num,rev=0,rem; clrscr(); printf(“Enter the Number=”); scanf(“%d”,&num); while(num!=0) { rem=num%10; rev=rev*10+rem; num=num/10; } if(num==0) printf( ” Reverse Number is=%d”,rev); getch(); } After Running Program 🙂

Checking property of triangle with C

#include<stdio.h> #include<conio.h> void main() { int a,b,c; clrscr(); printf(“insurt the value of side a,b,c”); scanf(“%d%d%d”,&a,&b,&c); (a==b&&b==c)?printf(“Equilateral”):(a==b || b==c || a==c)?printf(“Isoceles”):printf(“Scalene”); getch(); } After running the program 🙂