consider the following program sigment
int n,sum=1;
switch(n) {
case 2:sum=sum+2;
case 3:sum*=2;
break;
default:sum=0;}
if n=2, what is the value of sum
a.0
b.6
c.3
d.none
Answer Posted / guest
6
| Is This Answer Correct ? | 19 Yes | 0 No |
Post New Answer View All Answers
List some of the static data structures in C?
What is c token?
What is getch c?
What is a pointer and how it is initialized?
What is the difference between malloc() and calloc()?
Can stdout be forced to print somewhere other than the screen?
How can I generate floating-point random numbers?
Why do we use namespace feature?
Can a pointer be null?
Can a file other than a .h file be included with #include?
What is the maximum no. of arguments that can be given in a command line in C.?
Differentiate between #include<...> and #include '...'
Explain about C function prototype?
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?