Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged switch-case
1
votes
2
answers
1
switch case
int main() { int a =50; switch(a) { default: a=45; case 49: a++; case 50: a--; case 51: a =a+1; } printf("%d",a); } my doubt is the default case is not executed here why??, what is a value of a the end??
int main() { int a =50; switch(a) { default: a=45; case 49: a++; case 50: a ; case 51: a =a+1; } printf("%d",a); }my doubt is the default case is not executed here why??,...
Hira Thakur
1.4k
views
Hira Thakur
asked
Sep 14, 2018
Programming in C
switch-case
programming-in-c
+
–
1
votes
1
answer
2
Switch case
Output of the following program? #include <stdio.h> char input[ ] = "SSSWILTECH1\1\11W\1WALLMP1"; main() { int i,c; for( i=2 ; ( c=input[i] ) ! = '\0' ; i++) { switch(c) { case 'a' : putchar( 'i' );continue ... E' : case 'L' : continue; default : putchar (c); continue; } putchar( ' ' ); } putchar( '\n' ); }
Output of the following program?#include <stdio.h char input[ ] = "SSSWILTECH1\1\11W\1WALLMP1"; main() { int i,c; for( i=2 ; ( c=input[i] ) ! = '\0' ; i++) { switch(c) { ...
Vinay Yadav
659
views
Vinay Yadav
asked
Jun 29, 2017
Programming in C
switch-case
programming-in-c
+
–
0
votes
1
answer
3
switch-case
BREAK can be used in switch-case but CONTINUE is not allowed in switch-case but CONTINUE is allowed in DEFAULT case of switch-case..is it correct??
BREAK can be used in switch-case but CONTINUE is not allowed in switch-case but CONTINUE is allowed in DEFAULT case of switch-case..is it correct??
joshi_nitish
550
views
joshi_nitish
asked
Jun 28, 2017
Programming and DS
switch-case
+
–
3
votes
2
answers
4
Kerala PSC AP Exam
What will be the output of the following C program fragment? int n =1; switch(n) { case 1: printf("One"); case 2: printf("Two"); case 3: case 4: case 5: default: printf("Wrong Choice"); } A) One B) One Two Wrong Choice C) Two D) One Two
What will be the output of the following C program fragment?int n =1; switch(n) { case 1: printf("One"); case 2: printf("Two"); case 3: case 4: case 5: default: printf("W...
Sankaranarayanan P.N
392
views
Sankaranarayanan P.N
asked
Oct 27, 2016
Programming in C
programming-in-c
switch-case
+
–
3
votes
2
answers
5
GATE Overflow | Programming | Test 1 | Question: 9
No. of times '*' will be printed by the following C code is _____ #include<stdio.h> void foo(int x) { switch(x){ case 1: printf("*"); case 2: printf("*"); case 3: printf("*"); default: printf("*"); } } int main() { foo(2.5); }
No. of times '*' will be printed by the following C code is _____#include<stdio.h void foo(int x) { switch(x){ case 1: printf("*"); case 2: printf("*"); case 3: printf("*...
Arjun
1.2k
views
Arjun
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
switch-case
numerical-answers
+
–
77
votes
1
answer
6
GATE CSE 2015 Set 3 | Question: 48
Consider the following C program: #include<stdio.h> int main() { int i, j, k = 0; j=2 * 3 / 4 + 2.0 / 5 + 8 / 5; k-=--j; for (i=0; i<5; i++) { switch(i+k) { case 1: case 2: printf("\n%d", i+k); ... : printf("\n%d", i+k); default: printf("\n%d", i+k); } } return 0; } The number of times printf statement is executed is _______.
Consider the following C program:#include<stdio.h int main() { int i, j, k = 0; j=2 * 3 / 4 + 2.0 / 5 + 8 / 5; k-= j; for (i=0; i<5; i++) { switch(i+k) { case 1: case 2: ...
go_editor
22.3k
views
go_editor
asked
Feb 16, 2015
Programming in C
gatecse-2015-set3
programming
programming-in-c
switch-case
normal
numerical-answers
+
–
40
votes
5
answers
7
GATE CSE 2012 | Question: 3
What will be the output of the following C program segment? char inChar = 'A'; switch ( inChar ) { case 'A' : printf ("Choice A \ n"); case 'B' : case 'C' : printf ("Choice B"); case ... : printf ("No Choice"); } No Choice Choice A Choice A Choice B No Choice Program gives no output as it is erroneous
What will be the output of the following C program segment?char inChar = 'A'; switch ( inChar ) { case 'A' : printf ("Choice A \ n"); case 'B' : case 'C' : printf ("Choic...
gatecse
10.8k
views
gatecse
asked
Aug 5, 2014
Programming in C
gatecse-2012
programming
easy
programming-in-c
switch-case
+
–
To see more, click for the
full list of questions
or
popular tags
.
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register