0% found this document useful (0 votes)
130 views

Coding and Debugging 2nd Round

The document contains 10 coding and debugging questions with multiple choice answers. The questions cover topics like loops, if/else statements, switch statements, functions, data types, operators, and character conversions.

Uploaded by

Reddy theja K
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
130 views

Coding and Debugging 2nd Round

The document contains 10 coding and debugging questions with multiple choice answers. The questions cover topics like loops, if/else statements, switch statements, functions, data types, operators, and character conversions.

Uploaded by

Reddy theja K
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Coding And Debugging 2nd Round

1. What will happen when the following pseudocode is executed?

Set Integer Emp_no=101


Set Integer salary=0
while (Emp_no=501)
salary=salary+100
display salary
end-while

A. Code executes successfully and value of salary is displayed once.

B. Code executes successfully and nothing is displayed.

C. Code executes successfully and value of salary is displayed infinite times.

D. Compile time error.

9. What is the output of the below program?

int main()

int i,j,count;

count=0;

for(i=0; i<5; i++);

for(j=0;j<5;j++);

count++;

printf("%d",count);

return 0;

(A). 25 (B). 55

(C). 1 (D). 0
3. What will happen when the following program is executed?

Set Integer res=0


do
--res
display res
res++
while(res>=0)
end do-while

A. Code will run infinite number of times.

B. The program will not enter the loop.

C. Code will execute and value of res will be displayed twice.

D. Code will execute and value of res will be displayed once.

4.  What will be the output of the following pseudocode? 

Integer a, b, c
Set a = 4, b = 3, c = 1
if (a >> (c-1) && b << (c + 1))
a=a+c
Else
b = a <<< C
End if
Print a - b + c

(A). 3 (B). 5

(C). 8 (D). None of these

5.  What will be the output of the following pseudocode? 


Set Character c='7'
switch(c)
case '1': display "One"
case '7': display "Seven"
case '2': display "Two"
default: display "Hello"
break
end-switch

(A). SevenTwoHello (B). OneHello

(C). SevenTwo (D). Seven

6.  What will be the output of the following code snippet?

#include <stdio.h>
void solve() {
int ch = 2;
switch(ch) {
case 1: printf("1 ");
case 2: printf("2 ");
case 3: printf("3 ");
default: printf("None");
}
}
int main() {
solve();
return 0;
}
end-switch

(A). 1 2 3 None (B). 2

(C). 2 3 None (D). None

7. What will be the output of following pseudo code ?


#include<stdio.h>
int main()
{
float x = 0.0;
long int y = 10;
printf("%d", sizeof(x) == sizeof(x+y));
return 0;
}
(A). 1 (B). 0

(C). 4 (D). 10

8. what will be the output of the following Pseudo Code.

#include<stdio.h>
int main()
{
float i;
i = 1;
printf("%d",i);
return 0;
}

(A). 1 (B). Garbage Value

(c). 1.00000000 (D). Error

9. Which of the following options correctly explains the concept of Polymorphism?

(A).int func(float);  

float func(int, int, char);  
(B).int func(int);  
int func(int);  
(C).int func(int, int);  
float func1(float, float);  

d. None of the above


10. What is the output?

#include<stdio.h>

int main()

int any = ' ' * 10;

printf("%d", any);

return 0;

(A). 320 (B). 340

(C). 360 (D).380

You might also like