Don’t worry, unlock all articles / blogs on PrepInsta by just simply logging in on our website
Type atleast 3 characters
Popular Searches
Trending Pages
Notifications Mark All Read
No New notification
Infosys Menu9>
PREPINSTA PRIME
Get Hiring Updates right in your inbox from PrepInsta
Question 1
integer fun(int i) if((i%2)!=0) return i; else return fun(fun(i=1)); End function fun()
1
2
3
Error
Start
Question 2
#include<stdio.h> int main() { int x=2,y=0,z=3; x>y ?( printf("%d", z)):( return z); }
11
Question 3
Integer a, b, c, d, e Set a=50 , b=3, c=3 e=0 while(c>0) d=a mod b e= e + d + a c= c - 1 End while Print e
165
160
170
Question 4
for (i = 1; i <= 6; i++) for (j = i; j < 6; j++) Print blank space for (k = 1; k < (i * 2); k++) Print * End for Line break End for
* *** ***** ****** *******
* ** *** ***** ******* *********
* *** ***** ******* ********* ***********
None
Question 5
Start Declare a=0, I and b for I =0 to 4 Increment a by 1 if I = 3 then print hello get out of the loop End if End for print a
Hello4
Hello
Hello3
Question 6
#include<stdio.h> int f (int n) { static int a = 0; if (n <= 0) { return 1; } if (n > 3) { a = n; return f (n - 2) + 2; } return f (n - 1) + a; } int main () { printf ("Result: %d", f (5)); return 0; }
20
18
16
Question 7
integer a if((a mod 10) IS EQUAL TO 0) a=a*2 else if((a mod 5 ) IS EQUAL TO 0) a=a/5 else a=a-1 end if
5, 15
15, 5
25, 5
Compiler Error
Question 8
integer a,b; Set a=2; b=50; while(b>0) a = b%2 + a; if( a MOD 2 Is Equal To 0) Printf a else Print b-1 b = b/5 a=a+1 End while
2 9 4
4 9 2
8 18 4
Question 9
Integer array1[10] = {2, 3, 56, 34} Integer k, a, j, n Set a = 3, n = 4 for(each k from 0 to n-1) Set array1[n] = array1[0] for(each j from 0 to n-1) Set array1[j] = array1[j+1] End for End for for(each k from 0 to n-1) Print array1[k] End for
2 3 56 34
12 13 56 34
3 4 12 13
None of the mentioned
Question 10
Integer x,y,z Set x=3 Set y=90 while(y is greater than 0); y=y/3 x=x+6 c=x+y while(c is greater than 30): if(c mod 3 is equals to 0): Write x else: Write y c=c/5 Write c
9 18 15
6 33 9
9 33 6
Please login to report