what is the different between if-else and switch statment
(other than syntax)

Answer Posted / thiyagu.p

Simply saying, IF-ELSE can have values based on constraints
where SWITCH can have values based on user choice.

Is This Answer Correct ?    187 Yes 42 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are reserved words?

639


how should functions be apportioned among source files?

632


#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

1547


How can you increase the allowable number of simultaneously open files?

601


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1079






which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1142


What is a struct c#?

607


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

3694


What are the features of the c language?

652


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

650


What is calloc() function?

629


How can I dynamically allocate arrays?

601


Write a program to check palindrome number in c programming?

604


What is the use of gets and puts?

608


The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.

1637