write a program to accept 3 numbers and print the greatest number
Answers
Answered by
1
Answer:
In C language:
#include <stdio.h>
void main()
{
int a, b, c;
printf("Enter the values of a, b and c\n");
scanf("%d %d %d", &a, &b, &c);
printf("a = %d\b = %d\tc = %d\n", a, b, c);
if (a > b)
{
if (a > b)
{
printf("%a is the greatest among three \n",a);
}
else
{
printf("%d is the greatest among three \n",c);
}
}
else if (b > c)
printf("%d is the greatest among three \n",b);
else
printf("%d is the greatest among three \n",c);
}
Similar questions
Social Sciences,
6 months ago
History,
6 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago
Science,
1 year ago
Math,
1 year ago