fork download
  1. #include<stdio.h>
  2. 2 int main()
  3. 3 {
  4. 4 int SA=15,NA=5,threshold=10,integrated_data,CANMsg,Wait=0,Fire=0,Stop=0,CANFireMsg,counter=0,T1=100;
  5. 5 _Bool EnableFire=1,Fireflag=0,EnableCAN=1;
  6. 6 if (EnableFire==1)
  7. 7 {
  8. 8 integrated_data=SA-NA;
  9. 9 printf("Integrated data=%d\n",integrated_data);
  10. 10 if(threshold < integrated_data)
  11. 11 {
  12. 12 while(counter<T1)
  13. 13 {
  14. 14 counter++;
  15. 15 }
  16. 16 if(threshold < integrated_data && counter == T1 )
  17. 17
  18. 18 {
  19. 19
  20. 20 Fireflag=1;
  21. 21 printf("Fireflag is successfully set to 1\n");
  22. 22 }
  23. 23 }
  24. 24 else
  25. 25 {
  26. 26 Fireflag=0;
  27. 27 printf("Fireflag is in 0\n");
  28. 28 }
  29. 29 }
  30. 30
  31. 31 if (EnableCAN==1)
  32. 32 {
  33. 33 printf("enter the value of CANMsg\n");
  34. 34 scanf("%d",&CANMsg);
  35. 35 if(CANMsg==1||CANMsg==2)
  36. 36 {
  37. 37 CANFireMsg=Wait;
  38. 38 printf("CANFireMSG is Wait\n");
  39. 39 }
  40. 40 else if (CANMsg==3||CANMsg==4)
  41. 41 {
  42. 42 CANFireMsg=Fire;
  43. 43 printf("CANFireMSG is Fire\n");
  44. 44 }
  45. 45 else
  46. 46 {
  47. 47 CANFireMsg=Stop;
  48. 48 printf("CANFireMSG is stop\n");
  49. 49 }
  50. 50 }
  51. 51
  52. 52 if(Fireflag==1 && CANFireMsg==Fire)
  53. 53 printf("EventFireflag is set to high\n");
  54. 54 else
  55. 55 printf("Eventfireflag is set to low\n");
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60 }
  61.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
2
10
42
11
compilation info
prog.c:2:3: error: expected identifier or ‘(’ before numeric constant
   2 int main()
   ^
stdout
Standard output is empty