fork download
  1.  
  2. // C code
  3. // This program will calculate how many children are in a group of 20
  4. // Developer: NATISHA VARNUM
  5. // Date: 25 JUNE 2017
  6.  
  7. #include <stdio.h>
  8.  
  9. int main ()
  10. {
  11. /* variable definition: */
  12. int count; //Number of values input
  13. int value; //Age of group member input
  14. int c_count; //Sum of children in group age 12 or younger
  15.  
  16. /* Initialize */
  17. count = 0;
  18. c_count = 0;
  19.  
  20. //Loop through to input values
  21. while (count < 20)
  22. {
  23. printf("This is a child\n");
  24. scanf("%d", &value);
  25. if (value < 13) {
  26. count = count + 1;
  27. c_count = c_count + 1;
  28. }
  29. else {
  30. printf(“This is not a child\n”);
  31. }
  32. }
  33. return 0;
  34. }
  35.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
compilation info
prog.c: In function ‘main’:
prog.c:30:22: error: stray ‘\342’ in program
               printf(“This is not a child\n”);
                      ^
prog.c:30:23: error: stray ‘\200’ in program
               printf(“This is not a child\n”);
                       ^
prog.c:30:24: error: stray ‘\234’ in program
               printf(“This is not a child\n”);
                        ^
prog.c:30:25: error: ‘This’ undeclared (first use in this function)
               printf(“This is not a child\n”);
                         ^~~~
prog.c:30:25: note: each undeclared identifier is reported only once for each function it appears in
prog.c:30:30: error: expected ‘)’ before ‘is’
               printf(“This is not a child\n”);
                              ^~
prog.c:30:44: error: stray ‘\’ in program
               printf(“This is not a child\n”);
                                            ^
prog.c:30:46: error: stray ‘\342’ in program
               printf(“This is not a child\n”);
                                              ^
prog.c:30:47: error: stray ‘\200’ in program
               printf(“This is not a child\n”);
                                               ^
prog.c:30:48: error: stray ‘\235’ in program
               printf(“This is not a child\n”);
                                                ^
stdout
Standard output is empty