1. Write a c program to reverse a given number
2. C program to find reverse of a number
3. C program to reverse the digits of a number
4. Reverse of a number in c using while loop
#include int main(){ int num,r,reverse=0;
printf("Enter any number: "); scanf("%d",&num);
while(num){ r=num%10; reverse=reverse*10+r; num=num/10; }
printf("Reversed of number: %d",reverse); return 0;
}
Sample output:
Enter any number: 12
Reversed of number: 21
1. C program to check even or odd
2. C determine odd or even
3. How to check odd number in c
4. How to determine odd or even in c
5. C even odd test
#include
int main(){
int number; printf("Enter any integer: "); scanf("%d",&number);
if(number % 2 ==0) printf("%d is even number.",number); else printf("%d is odd number.",number); return 0;
}
1. C program to add digits of a number
2. C program for sum of digits of a number
3. C program to calculate sum of digits
#include int main(){ int num,sum=0,r; printf("Enter a number: "); scanf("%d",&num); while(num){ r=num%10; num=num/10; sum=sum+r; } printf("Sum of digits of number: %d",sum); return 0;
}
Sample output:
Enter a number: 123
Sum of digits of number: 6
#include
#include void main()
{
float length, breadth, radius, aor, por, aoc, coc; printf ("\nEnter the Length and Breadth of the Rectangle: "); scanf("%f %f", &length,&breadth); printf("\nEnter the Radius of the Circle: "); scanf("%f", &radius); aor = length*breadth; por= 2*(length+breadth); aoc = 3.14*radius*radius; coc = 2*radius*3.14; printf("\nThe area of the rectangle is: %f", aor); printf("\nThe perimeter of the rectangle is: %f ", por); printf("\n\nThe area of the Circle with radius %f is: %f ", radius, aoc); printf("\nThe circumference of the same circle is: %f", coc); getch(); }