/* Find largest among 3 variables using nested if */
#include <stdio.h>
int main()
{
int a,b,c;
printf("Enter 3 numbers: \n");
scanf("%d %d %d",&a,&b,&c);
if(a>=b)
{
if(a>=c)
printf("%d is largest",a);
else
printf("%d is largest",c);
}
else if(b>=c)
printf("%d is largest",b);
else
printf("%d is largest",c);
return 0;
}
Related Posts
Largest value among three variables
http://cbasicprogram.blogspot.in/2012/02/largest-value-among-three-variables.html
Find largest value among three variable - conditional operator
http://cbasicprogram.blogspot.in/2012/01/find-largest-value-among-three-variable.html
#include <stdio.h>
int main()
{
int a,b,c;
printf("Enter 3 numbers: \n");
scanf("%d %d %d",&a,&b,&c);
if(a>=b)
{
if(a>=c)
printf("%d is largest",a);
else
printf("%d is largest",c);
}
else if(b>=c)
printf("%d is largest",b);
else
printf("%d is largest",c);
return 0;
}
Related Posts
Largest value among three variables
http://cbasicprogram.blogspot.in/2012/02/largest-value-among-three-variables.html
Find largest value among three variable - conditional operator
http://cbasicprogram.blogspot.in/2012/01/find-largest-value-among-three-variable.html
where is the output
ReplyDeleteI need output
ReplyDeletewhere is algorithm and flowchart
ReplyDeletewow no getch fn used and also include conio lib
ReplyDeleteIt is int main() bitch.
DeleteThis comment has been removed by the author.
ReplyDeleteIf we include conio.h den we r able to use those clrscr n getch in d program otherwise not
ReplyDeletehttps://maytinhtrananh.vn/sua-may-tinh-may-in.html
ReplyDeletehttps://phalebinhminh.com