Professional Documents
Culture Documents
Question 1: The Following Query Belongs To Which Condition Types? SELECT
Question 1: The Following Query Belongs To Which Condition Types? SELECT
SELECT
fname FROM person WHERE dept_id= (SELECT dept_id FROM department
WHERE names=’s’);
1. Equality condition
2. Inequality condition
3. Range condition
4. All of the mentioned
Answer: Option A
typedef struct p
int x, y;
}k;
int main()
k k1 = p;
printf(“%d\n”, k1.x);
B.1
C. 0
Answer: Option B
Question 3: typedef which of the following may create problem in the
program?
A. ;
B. printf/scanf
C.Arithmetic operators
Answer: Option D
This series is a mixture of 2 series – all the odd terms in this series form a
geometric series and all the even terms form yet another geometric series.
Write a program to find the Nth term in the series.
The value N is a positive integer that should be read from STDIN. The Nth
term that is calculated by the program should be written to STDOUT. Other
than the value of the nth term, no other character/string or message should
be written to STDOUT. For example, if N=16, the 16th term in the series is
2187, so only value 2187 should be printed to STDOUT.
Answer: #include”stdio.h”
#include”math.h”
int main()
int input;
scanf(“%d”, &input);
if(input % 2 == 0)
int x = number – 1;
printf(“%d”, output);
else
int x = number – 1;
printf(“%d”, output);
return 0;
int main()
int a = 0, i = 0, b;
a++;
continue;
A. 2
B. 3
C. 4
D. 5
Answer: Option D
void foo();
int main()
void foo();
foo();
return 0;
void foo()
{
printf(“2 “);
B. 2
Answer: Option B
This series is a mixture of 2 series – all the odd terms in this series form a
Fibonacci series and all the even terms are the prime numbers in ascending
order. Now write a program to find the Nth term in this series.
Answer: #include<stdio.h>
void fibonacci(int n)
int i, t1 = 0, t2 = 1, nextTerm;
nextTerm = t1 + t2;
t1 = t2;
t2 = nextTerm;
}
printf(“%d”, t1);
void prime(int n)
flag = 0;
if(i%j == 0)
flag = 1;
break;
if (flag == 0)
if(++count == n)
printf(“%d”, i);
break;
int main()
int n;
scanf(“%d”, &n);
if(n%2 == 1)
else
prime(n/2);
return 0;
A. Volatile
B. True
C. friend
D. export
Answer: Option A
B. double PI = 3.14;
C. int PI = 3.14;
D. #define PI 3.14
Answer: Option D
Answer: Option B
Explanation: