program for finding a bigger number in 4 numbers
program for finding a bigger number in 4 numbers
#include<stdio.h>
void main()
{
int a,b,c,d;
printf("Enter first no. :");
scanf("%d",&a);
printf("Enter second no. :");
scanf("%d",&b);
printf("Enter third no. :");
scanf("%d",&c);
printf("Enter fourth no. :");
scanf("%d",&d);
if(a>b&&a>c&&a>d)
printf("%d is greater",a);
else if(b>c&&b>d&&b>a)
printf("%d is greater",b);
else if(c>a&&c>b&&c>d)
printf("%d is greater",c);
else
printf("%d is greater",d);
}
#include<stdio.h>
void main()
{
int a,b,c,d;
printf("Enter first no. :");
scanf("%d",&a);
printf("Enter second no. :");
scanf("%d",&b);
printf("Enter third no. :");
scanf("%d",&c);
printf("Enter fourth no. :");
scanf("%d",&d);
if(a>b&&a>c&&a>d)
printf("%d is greater",a);
else if(b>c&&b>d&&b>a)
printf("%d is greater",b);
else if(c>a&&c>b&&c>d)
printf("%d is greater",c);
else
printf("%d is greater",d);
}
out put :-
No comments: