0
Can anyone please tell me what is wrong in my code
7 Answers
+ 4
In declaration, variable don't allowed to have '-'.
Use _ , instead of -.
instead use short form like fail_students, pass_stidents simply.
+ 2
At line 8, 10 and 12 variable names (number_of_students_passed_in_exam, number_of_students_failed-in_exam) were written with spaces where underscores should be.
+ 1
Thanks
+ 1
Still something is wrong can please check now ?
+ 1
#include <stdio.h>
#define NUM_PASSED_PROMPT "Enter the number of students passed in the exam: "
#define NUM_FAILED_PROMPT "Enter the number of students failed in the exam: "
int main()
{
int num_passed, num_failed, total;
printf(NUM_PASSED_PROMPT);
scanf("%d", &num_passed);
printf(NUM_FAILED_PROMPT);
scanf("%d", &num_failed);
total = num_passed + num_failed;
printf("%d + %d = %d", num_passed, num_failed, total);
return 0;
}
0
There's no mistake in your code
In the same input chose 2 number like 2 3 and result will be 5
0
Godddd