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