Switch (i)
i=1;
case 1
i++;
case 2
++i;
break;
case 3
--i;
Output of i after executing the program

Answer Posted / shruti

WHAT IS THE VALUE OF I BEFORE ENTERING THE SWITCH CASE???

if the values is something other than 1 , 2 , 3 there wont
be any effect, ASSUMING u have forgotton to give the curly
braces.


otherwise,
you will get an error, if the curly braces are not there
for the switch case.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are global variables?

647


What is call by value in c?

558


What is the difference between procedural and functional programming?

517


Write a code on reverse string and its complexity.

608


When should we use pointers in a c program?

632






Explain how are portions of a program disabled in demo versions?

655


Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given

2517


When should a far pointer be used?

604


List the different types of c tokens?

627


What is structure pointer in c?

571


Is a house a shell structure?

697


write a c program for swapping two strings using pointer

2094


What is difference between static and global variable in c?

539


How can I automatically locate a programs configuration files in the same directory as the executable?

632


What is && in c programming?

679