Home >Backend Development >C#.Net Tutorial >How to find the maximum value in C language

How to find the maximum value in C language

coldplay.xixi
coldplay.xixiOriginal
2020-08-29 10:09:5052910browse

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.

How to find the maximum value in C language

[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 ).

How to find the maximum value in C language

#2. You can see that there are no errors or warnings.

How to find the maximum value in C language

#3. Then press the run button (or directly press the shortcut key Ctrl F5) to run the program.

How to find the maximum value in C language

4. Enter three numbers 454 12 861 to test the code. The results are as follows and it runs correctly.

How to find the maximum value in C language

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);
}

How to find the maximum value in C language

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn