Result of the following program is
main()
{
int i=0;
for(i=0;i<20;i++)
{
switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
printf("%d,",i);
}
}
a)0,5,9,13,17
b)5,9,13,17
c)12,17,22
d)16,21
e)syntax error
Answer Posted / deepa
syntax error every case statement requires a break statement
| Is This Answer Correct ? | 7 Yes | 32 No |
Post New Answer View All Answers
Is c a great language, or what?
What are enumerated types?
How can I pad a string to a known length?
Can we compile a program without main() function?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
What type of function is main ()?
How reliable are floating-point comparisons?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
What are the different types of endless loops?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
How can you find out how much memory is available?
Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250
What is a loop?