About Loading and Displaying

Asked 2 years ago, Updated 2 years ago, 33 views

I'm in trouble because I can't write exercises 1-5.I haven't started yet, so please let me know🙏

Enter a description of the image here

I'm in trouble because I can't put the number I entered in the execution result

#include<stdio.h>

int main()
{
int no;
printf("Enter an integer.\n");
scanf("%d", & no);

printf(" plus 12 equals %d.\n",12+no);

return 0;

}

c++

2022-09-30 16:30

2 Answers

printf(" plus 12 equals %d.\n",12+no);

printf("%d plus 12 equals %d.\n", no, 12+no);

I think it will be solved if
For more information, see how to use printf and how to format it.

I don't know what the book is, but it's basic, so I think there will be an explanation somewhere in the book.


2022-09-30 16:30

You should have compiled it to run it, but did you get any messages when you compiled it?

If the program in the questionnaire is entered with full-width symbols such as {, }, ", and the actual source code remains full-width, an error occurs during compilation.

After compiling these symbols in half-width, there was no problem running the generated program (a.out).


2022-09-30 16:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.