I'm sorry, but please take a look at the basic language problem crying

Asked 2 years ago, Updated 2 years ago, 99 views

I'm sorry to ask you the most basic question, but the question is Write a program that reads two integers a and b to find the sum and outputs it as follows. Program execution result 1 Input of two integers a and b: 23 2 +3 == 5 Program execution result 2 Input of two integers a and b: 2-3 2 -3 == -1
Here's the question. It's a basic visual studio, but the one I made is

void main() { int a, b, area;

printf ("two integers a, b force:");
scanf_s("%d, %d", &a, &b);
area = a + b;

printf("area=%d \n", area);

}

If you type a and b and press Enter, the window will turn off immediately What's the problem?

c=+

2022-09-22 18:07

1 Answers

Enter the properties of the current project in the Visual Studio (vs). Right-click the project's name in the Solution Explorer. Once in the properties, click <Linker> in the left menu to expand. Then there's <System> in the sub-lists, if you click on it, a window appears on the right. At the top is <Subsystem>. Click the blank next to it, lower the scroll bar, select <Console>, and click OK. I'll attach a picture. If you can't find the Solution Explorer, click <View> on the toolbar at the top of the vs.


2022-09-22 18:07

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.