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 |
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above
The differences between Windows XP and Windows Visa
Explain what is the benefit of using enum to declare a constant?
What is the general form of function in c?
write a prgram of swapping with 2 valiables
#include<conio.h> #include<stdio.h> void main() { int i; if(1,0,2,3) { printf("if"); } else { printf("else"); } getch(); } Can any body tell the answer of this question with explanation?
print the table 5 in loops
Why c language?
What is the size of empty structure in c?
we have to use realloc only after malloc or calloc ? or we can use initially with out depending on whether we are using malloc or calloc in our program ?
I need testPalindrome and removeSpace #include <stdio.h> #define SIZE 256 /* function prototype */ /* test if the chars in the range of [left, right] of array is a palindrome */ int testPalindrome( char array[], int left, int right ); /* remove the space in the src array and copy it over to the "copy" array */ /* set the number of chars in the "copy" array to the location that cnt points t */ void removeSpace(char src[], char copy[], int *cnt); int main( void ) { char c; /* temporarily holds keyboard input */ char string[ SIZE ]; /* original string */ char copy[ SIZE ]; /* copy of string without spaces */ int count = 0; /* length of string */ int copyCount; /* length of copy */ printf( "Enter a sentence:\n" ); /* get sentence to test from user */ while ( ( c = getchar() ) != '\n' && count < SIZE ) { string[ count++ ] = c; } /* end while */ string[ count ] = '\0'; /* terminate string */ /* make a copy of string without spaces */ removeSpace(string, copy, ©Count); /* print whether or not the sentence is a palindrome */ if ( testPalindrome( copy, 0, copyCount - 1 ) ) { printf( "\"%s\" is a palindrome\n", string ); } /* end if */ else { printf( "\"%s\" is not a palindrome\n", string ); } /* end else */ return 0; /* indicate successful termination */ } /* end main */ void removeSpace(char src[], char copy[], int *cnt) { } int testPalindrome( char array[], int left, int right ) { }
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL