Which of the following about the C comments is incorrect ?
a.commentscan go over multiple lines
b.comments can start any where in the line
c.a line can contain comments with out any language statements
d.comments can occur within comments
Answers were Sorted based on User's Feedback
Answer / arpit dhandhania
Answer is d it is not possible to write nested comments in C
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / kushal
@above
your syntax is false,thats why u r getting an error,
if u write like this,
scanf("%d,%d", c /*dis are the values to be printed */ a,b);
then u will nt face any error
write ans shold be
<d>
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / shikhar
answer : c
Reason : a line cannot contain comments with out any
language statements since it will give an syntax error. i.e
"the code didn't recognize the unformatted text."
for example :
scanf("%d,%d", c //dis are the values to be printed // a,b);
Here, the comments inside scanf will not recognize the
comment n hence outputs an error.
| Is This Answer Correct ? | 2 Yes | 7 No |
write a program to find the sum of the array elements in c language?
24 Answers ICT, Infosys, Wipro,
How many types of linked lists what are they? How many types of data structures?
18 Answers BSNL, Pivotal Software,
What is the difference between a structure and a union?
What is pre-emptive data structure and explain it with example?
What is the difference between the local variable and global variable in c?
Where is c used?
What is the benefit of using const for declaring constants?
typedef struct { int i:8; char c:9; float f:20; }st_temp; int getdata(st_temp *stptr) { stptr->i = 99; return stptr->i; } main() { st_temp local; int i; local.c = 'v'; local.i = 9; local.f = 23.65; printf(" %d %c %f",local.i,local.c,local.f); i = getdata(&local); printf("\n %d",i); getch(); } why there there is an error during compiling the above program?
read an array and search an element
Program to swap the any two elements in an array containing N number of elements?
1 Answers Bosch, Glenwood, Ugam Solutions,
main() { clrscr(); } clrscr();
a simple c program using 'for' loop to display the output 5 4 3 2 1