Write a C-program to print max number among three numbers
#include <stdio.h>
int main() {
int x,y,z;
printf("Enter x,y,z values ");
scanf("%d%d%d",&x,&y,&z);
if(x>y && x>z)
{
printf("%d is max number",x);
}
else if(y>x && y>z)
{
printf("%d is max number",y);
}
else if(z>x && z>y)
{
printf("%d is max number",z);
}
return 0;
}
Output:
Enter x,y,z values 10 20 30
30 is max number
Enter x,y,z values 100 20 30
100 is max number
More Programs
37 . Write a C-program to print max number among three numbers
38 . Write a C-program to print 1 to 10 values using for loop
39 . Write a C-program to print 10 to 1 values using for loop
40 . Write a C-program to print 1 to n values using for loop
41 . Write a C-program to print even numbers using for loop
42 . Write a C-program to print even number or odd number based on the n value using for loop
43 . Write a C-program to print even number or odd number based on the n value using single for loop
44 . Write a C-program to count the number of divisible numbers in a given range(1-100)
45 . Write a C-program to print count the number of divisible numbers in a given range(1-100) without using loop
46 . Write a C-program to print factorial number using for loop
47 . Write a C-program to print factorial of n numbers using for loop