main.c:13:1: error: expected identifier or ‘(’ before ‘{’ token

0 votes
asked Dec 11, 2018 by Abdel

int a = 0;
#pragma omp parallel private(a)
{
  a++;
  printf ("%d", a);
}
 

I got an exercise where I have to say what the output of printf is but it shows 

main.c:13:1: error: expected identifier or ‘(’ before ‘{’ token

and I do not know what to do :( sorry I am a noob to c

2 Answers

0 votes
answered Dec 11, 2018 by anonymous
#include<stdio.h>

int a=0;

int main()

{

a++;

printf("%d",a);

}
commented Dec 11, 2018 by Shailesh kumar
Yes right ans
commented Jan 19, 2019 by anonymous
yes you are right
–1 vote
answered Jan 13, 2019 by SHUBHAM GOYAL (120 points)
you want void main() before upper {
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...