Tìm số lớn nhất trong 3 số

Viết chương trình tìm số lớn nhất trong 3 số.
 avatar
nguyenthanhtruong
c_cpp
a year ago
367 B
3
Indexable
//Write a program to find the largest number among three numbers.

#include <stdio.h>
#include <math.h>

int main() {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    if (a >= b && a >= c){
        printf("%d", a);
    }
    else if(b >= a && b >=c ){
         printf("%d", b);
    }
    else{
        printf("%d", c);
    }
    return 0;
}
Editor is loading...
Leave a Comment