Interactive Powerpoint_How to Master effective communication
CODING QUESTIONS.pptx
1. 1. Give Output to the following Code
#include
int main()
{
typedef int num;
num bunk = 0.00;
printf(“%d”, bunk);
return 0;
}
Options:
1. 0
2. 0.0
3. Error
4. None of the above
2. 2. What is the Possible Output of the Given Code?
#include
int main()
{
int go = 5.0, num = 1*10;
do
{
num /= go;
} while(go--);
printf (“%dn”, num);
return 0;
}
Options:
1. No Output 2.Compilation Error
3.Floating Pointer Exception 4. 5 10 15
3. 3. Give Output of the Following Program
public class Main
{
public static void main(String[] args)
{
String names[] = new String[5];
for(int x=0; x
Options:
1. Exception
2. Null
3. None
4. Compilation Error
4. 4. What will be the output of the following Java Pseudo Code?
public class Main
{
public static void main(String[] args)
{
String names[] = new String[5];
for(int x=0; x<args.length; x++)
names[x] = args[x];
System.out.println(names[2]);
}
}
1. Null
2. Name
3. Exception
4. Compilation Error
5. 5. What will happen when the following program is executed?
Set Integer res=0do
--res
display res
res++
while(res>=0)
end do-while
1. The code will run an infinite number of times.
2. The compiler will not enter inside the loop.
3. The value of res will be displayed twice.
4. A program will compile and the value of res will be displayed once.
6. 6. Find the output of following pseudo code :
Integer p, q, r, s
Set p=1, q = 1
for (each r from 0 to 2 )
for (each s from -4 to -2 )
p = p + 2if(p > r)
Continue
End if
p = 1if(p > s)
Jump out of the loop
End if
End for
End for
Print p + q}}
• 35
• 13
• 24
• 20
7. 7.What will be the output of the following pseudocode for a = 4 and b = 9?
Integer funn(Integer a, Integer b)
If(a < b)
Return 1 + funn(a, b – 2)
End If
If(a^b > a&b)
Return a ^ b
Else
Return a & b
End If
Return 1
End function funn()
• 10
• -8
• 14
• 24
8. 8. What will be the output of the following pseudocode?
Integer count
For (each count from 0 to 9)
Print "#"
If (count > 6)
CONTINUE
Print count
End For
• 0#1#2#3#4#5#6#7#8#9#10
• 0#1#2#3#4#5#6###
• ‘#0#1#2#3#4#5##7#8#9#10
• ‘#0#1#2#3#4#5#
9. 9.What will be the output of the following pseudo-code:
Integer m
Set m = 0
Integer p[5] = {1, 1, 0, 1, 7}
If (p[0] && P[4])
m = p[1]
End If
If (p[2] && p[3])
m = p[2]
End If
Print m
• 1
• -5
• 4
• 18
10. 10. What will be the output of the following pseudo code ?
#include<stdio.h>
int fun(int x, int y);
int main()
{
int i,n;
n=7;
int f= fun(5,7);
printf(“%d”, f);
}
int fun(int x, int y){
if( x<=0)
return y;
Else
Return(fun(x-1,y-1));
} A)0 B) 1
C)2 D) 3