f1()
{
f(3);}
f(int t)
{
switch(t);
{
case 2: c=3;
case 3: c=4;
case 4: c=5;
case 5: c=6;
default: c=0;}
value of c?
Answers were Sorted based on User's Feedback
Answer / ningappa
The above code returns a compiler error:
1.In C functions cannot be made inline.
2.A semi-colon is not expected after switch.
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / madhu
As t = 3,it goes to case 3.But there is no break in that
case so it proceeds further down to default and c becomes 0.
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / poornima
Initially, switch statement is ended with semicolon.so
cases will not be alone without switch.It is compilation
error.
If semicolon is not there in switch statement answer is
zero.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / shruti
Yeah value of c becomes 0 at the end of the program..
| Is This Answer Correct ? | 3 Yes | 1 No |
What are the average number of comparisons required to sort 3 elements?
How can you allocate arrays or structures bigger than 64K?
what is the output of the code and how? main() { int *ptr,x; x=sizeof(ptr); printf("%d",x); }
Why doesnt that code work?
main() { int a=0; if(a=0) printf("Ramco Systems\n"); printf("India\n"); } output?
Reverse the part of the number which is present from position i to j. Print the new number.[without using the array] eg: num=789876 i=2 j=5 778986
What is uint8 in c?
#include<stdio.h> main(0 { printf("\n %d %d %d",sizeof(3),sizeof("3"),sizeof(3)); }
if p is a string contained in a string?
if function is declared as static in one source file, if I would like to use the same function in some other source file...is it possible....how ?
Why should I use standard library functions instead of writing my own?
can i know the source code for reversing a linked list with out using a temporary variable?