Home > Article > Backend Development > How to find the maximum value in C language
How to find the maximum value in C language: first edit the code in Vc and save the [.c] file; then click the build button to check whether there are warnings and click run; finally enter three numbers to test the code That’s it.
[Related learning recommendations: C language tutorial video]
c Method for finding the maximum value in language:
1. First edit the code in vc6.0, save it as a .c
file, and then click the build button (or press the F7 shortcut key on the keyboard ).
#2. You can see that there are no errors or warnings.
#3. Then press the run button (or directly press the shortcut key Ctrl F5) to run the program.
4. Enter three numbers 454 12 861 to test the code. The results are as follows and it runs correctly.
5. The c language code for finding the maximum value of three numbers is posted below:
#include <stdio.h> main(){ int a,b,c; int big; printf("请输入3个数\n"); scanf("%d %d %d",&a,&b,&c); if(a>=b)big=a; else big=b; if(c>big) big=c; printf("最大数是%d\n",big); }
If you want to know more about programming learning, please pay attention to the php training column!
The above is the detailed content of How to find the maximum value in C language. For more information, please follow other related articles on the PHP Chinese website!