Compile Error
foo.c: In function 'main': foo.c:5:30: error: 'n1' undeclared (first use in this function) 5 | scanf("%d %d %d %d",&n1,&n2,&n3,&n4); | ^~ foo.c:5:30: note: each undeclared identifier is reported only once for each function it appears in foo.c:5:34: error: 'n2' undeclared (first use in this function) 5 | scanf("%d %d %d %d",&n1,&n2,&n3,&n4); | ^~ foo.c:5:38: error: 'n3' undeclared (first use in this function) 5 | scanf("%d %d %d %d",&n1,&n2,&n3,&n4); | ^~ foo.c:5:42: error: 'n4' undeclared (first use in this function) 5 | scanf("%d %d %d %d",&n1,&n2,&n3,&n4); | ^~ foo.c:25:1: error: expected declaration or statement at end of input 25 | } | ^
Code
#include <stdio.h>
int main()
{
scanf("%d %d %d %d",&n1,&n2,&n3,&n4);
if(n1<n2 && n1<n3 & n1<n4){
printf("%d",n1);}
else if(n2<n1 && n2<n3 & n2<n4){
printf("%d",n2);}
else if(n3<n1 && n3<n2 & n3<n4){
printf("%d",n3);}
else{
printf("%d",n4);
}
//for highest
if(n1>n2 && n1>n3 & n1>n4){
printf("%d",n1);}
else if(n2>n1 && n2>n3 & n2>n4){
printf("%d",n2);}
else if(n3>n1 && n3>n2 & n3>n4){
printf("%d",n3);}
else{
printf("%d",n4);
printf("hello, world\n");
}
Information
- Submit By
- Type
- Submission
- Problem
- P1022 Minmax
- Contest
- Brain booster - 1
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2023-12-31 13:39:52
- Judged At
- 2024-11-11 03:46:36
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes