fork download
  1. #include<stdio.h>
  2. void main()
  3. {
  4. int num,count=-1,num1,ount=0,set=0;
  5. while(scanf("%d",&num)>0))
  6. {
  7. if(num!=-1)
  8. {
  9. count++;
  10. if(count>0)
  11. {
  12. if(num1=num)
  13. {
  14. set++;
  15. num1=num;
  16. ount++;
  17. }
  18.  
  19. else
  20. {
  21. num1=num;
  22. ount++;
  23.  
  24. }
  25. }
  26. else
  27. {
  28. break;
  29. }
  30. }
  31. printf("%d",ount-set);
  32.  
  33. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:2:1: error: 'main' must return 'int'
void main()
^~~~
int
prog.c:5:27: error: extraneous ')' after condition, expected a statement
        while(scanf("%d",&num)>0))
                                 ^
prog.c:12:12: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
                                if(num1=num)
                                   ~~~~^~~~
prog.c:12:12: note: place parentheses around the assignment to silence this warning
                                if(num1=num)
                                       ^
                                   (       )
prog.c:12:12: note: use '==' to turn this assignment into an equality comparison
                                if(num1=num)
                                       ^
                                       ==
prog.c:33:2: error: expected '}'
}
 ^
prog.c:3:1: note: to match this '{'
{
^
1 warning and 3 errors generated.
stdout
Standard output is empty