358 views
0 votes
0 votes

Consider the below given C code:

Void main()
{
int x=5,y=2;
int *p;
p=&x;
y=*p;
x=*y;
printf("y is %d x is %d\n",y,x);
}

Choose the correct option:

  1.  No error in this code
  2.  The following program has 1 lexical error, 1 syntax error.
  3.  The following program has 1 lexical error, 1 semantic error.
  4.  The following program has 1 lexical error only.

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
1
rahul sharma 5 asked Apr 28, 2018
1,442 views
int a = b+*/c;Which phase will give the error?Lexical or syntax?
0 votes
0 votes
3 answers
2
OneZero asked Jan 21, 2019
987 views
int main(){int a = 10;fun(a);}void fun(int a){printf(“%d”,a);}Which phase of the compiler will raise an error?Lexical syntaxsemanticsnone of the above
0 votes
0 votes
1 answer
3
sourabh asked Jan 1, 2016
569 views
What type of error in programmain(){int gate,exam;gate=exam=10.3;printf("%c",gate);}LexicalSyntaxSemanticNone of these
3 votes
3 votes
2 answers
4
Himanshu1 asked Jan 1, 2016
1,998 views
Find the $C$ statement which has a syntax error.If (z)For (a, b, c)While (a, b)None of these.