Sie sind auf Seite 1von 3

Previous Questions

Question 27
#include <stdio.h> Int main()
{
Int n,ch, for(n=7;n!=0;n–)
printf(“n=%d”,n–) ch=getchar(); Return 0;
}
Infinite loop
Numbers 7 to 0 in descending order
None of the other choices as there is a compilation error Numbers 7 to 1 in descending
order.
Ans: Infinite loop
Question 28
Eesha works for ISRO where she is involved in a mission to intercept a comet that is likely
to collide with in each with in 1 month.she is developing a c program to calculate the
trajectory of the missile to be launched to intercept and destroying the approaching comet.in
order to achieve highest accuracy of the missile trajectory what data type should she use for
the variables in her equation??

 Long int
 Double
 Float
 Int Ans: Double

Question 29
a program reads in 500 integers in the range [0…100]representing the scores of 500
students.it then prints the frequency of each score above 50.what would be the best way for
the program to store the frequencies?

 An array of 101 numbers


 An array of 50 numbers
 An array of 500 numbers
 A dynamically allocated array of 550 numbers Ans: An array of 50 numbers
Question 30
Which of the following is TRUE about binary trees?
The number of nodes on the last level is equal to the sum of the number of nodes on all
other levels
A.A node may have one child

 The total number of nodes is one less than a power of 2

 Every node must have 2 children Ans : A node may have one child

Question 31
#include <studio . h> Long int fact (int n);
Int main ()
{
Int n;
Printf (“enter a positive integer: “); Scanf (“%d”, &n);
printf(“factorial of %d = %ld “, n, fact (n)); Return 0;
}
Long int fact (int n)
{
If (n.=1)
Return n*fact (n-1)
Else
}
Return 1;
Ans: recursion
Question 32
Not a core of os
a)multi tasking
b) memory management
C) virus protection
d) file management
Answer – C
Question 33
Which are crt options for array
A) same type
B) sequential memory allocation
c) we can change size of array at run time
D) counting items appropriate
Answer !
Question 34
Which of the following statements are true..?
1. DFS linearly grows with depth.
2. BFS always has the shortest path from start state to goal state.
3. DFS uses stack
4.BFS uses queue.
Question 35
Esha writes a prgm for factorial but she forgot to write the function fact what is the error
displayed
A)file not found
B)syntax errors
c)it takes the function from standard library
Question 36
Eesha wants to incorporate a history feature .When she presses “go back” then it will be
able to be vist the previous page.what data type is used ?
1. Tree
2. Queue
3. Stack
4. Array.

Das könnte Ihnen auch gefallen