Loading

Showing posts with label Largest Of 3 Numbers. Show all posts

C - Program To Find The Largest Of 3 Numbers

C - Program To Find The Largest Of 3 Numbers



#include<stdio.h>

int main() {

 int a, b, c;
 printf("Enter the value for a:\n");
 scanf("%d", &a);
 printf("Enter the value for b:\n");
 scanf("%d", &b);
 printf("Enter the value for c:\n");
 scanf("%d", &c);
 if ((a > b) && (a > c)) {
  printf("\n The big one is a= %d", a);
 } else if (b > c) {
  printf("\n The big one is b= %d", b);
 } else {
  printf("\n The big one is c= %d", c);
 }
 return 0;
}

Posted in | Leave a comment