Hello. I'm asking you this question because I'm trying to find a c language error, but I can't make any progress.!!

Asked 2 years ago, Updated 2 years ago, 68 views

Hello! It's my first time writing, but I can't solve it, so I post it like this. First, the Run window should look like this.

[Executive screen 1] Enter an integer: 90 Enter an integer: 107 Large integer: 107, Small integer: 90 Press any key to continue.

And the source file is like this


int main(void)
{
int num1;
int num2;

num1 = GetInteger();
num2 = GetInteger();

printf("large integer: %d, small integer: %d", GetMax(num1,num2), GetMin(num1,num2));
}```

 From here on, it's in the header file. (Dajungs Compilation)
void GetInteger(void)
{
int num;

printf ("Enter an integer:");
scanf("%d",num);
return num;
}
int GetMax(int x, int y)
{
return (x>y) ? x : y;
}
int GetMin(int x, int y)
{
return (x }

It's written like this. I really want to ask you where and how it's wrong.

c visual-studio-2010

2022-09-21 17:01

1 Answers

I believe you omitted the include

얼핏 보기에는 마지막 줄

int GetMin(int x, int y) { return (x } <<

I don't know if this part is a bug or if it was a typo when you posted it.

I think it will be more helpful to answer if you post what kind of error there is.


2022-09-21 17:01

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.