search
Log In
0 votes
400 views
Choose the statement that are syntactically incorrect in C language?

1.for( ; ; );

2./* this is a /* a valid */ comment*/

3.return 5;

4.return(6+3);
in Programming 400 views
0
2 is wrong. You can break it like this.
 /* this is a /*
a valid
*/ comment*/
0
You just copy please explain how is it wrong .
0
/* this is a /*   ==> This is comment.
a valid         ==> This will give error. Because it is not a comment.
*/ comment*/  ==> This is also comment.

for( ; ; ); This is correct. This is infinite loop. Conditional part is always true.

For option 3 and 4, They are very obvious. They are  correct.

2 Answers

0 votes
a function can return only one value at a time,

edited by
1
But in line 4 it is not returning two values. It is adding 6 and 3 and then returning their sum.
0 votes
Only 2 is incorrect. As we know a comment in C starts with /* and ends with */. There is no concept of nested comment in C . Once we put */ , the comment ends there. Rest of the line is considered as redundant and hence is synctactically incorrect in C

Related questions

1 vote
1 answer
1
896 views
Which of the following is not the member of class ? 1.Static function 2.Friend dunction 3.const. function 4.Virtual function
asked Jun 13, 2017 in Programming Harikesh Kumar 896 views
0 votes
1 answer
2
160 views
Which contains the information about a file that is needed by the system programs that access the file records? 1.A file header 2.A file descriptor 3.Bootstrap 4.Both 1 and 2
asked Jun 13, 2017 in Operating System Harikesh Kumar 160 views
0 votes
1 answer
3
113 views
A logical schema is a database 1. is the entire database 2.is the standard way of organizing information into accessible parts 3.describes how data actually store in disk 4.all of the above
asked Jun 13, 2017 in Databases Harikesh Kumar 113 views
0 votes
1 answer
4
480 views
A sorting algorithm is called stable if 1.It takes O(n log n) time 2.It maintains relative order of occurrence of non-distinct elements 3.It uses divide and conquer paradigm 4.It takes linear time
asked Jun 13, 2017 in Algorithms Harikesh Kumar 480 views
...