Binsys Technologies Pvt.
Ltd
H-33/48, DLF-Phase-1, Gurgaon (HR)
C Language (Theory)
Total Marks: 100
Total Time: 3 Hrs.
Date: July 24, 2009 Time:
9:00 A.M-12:00 P.M
Instructions
1. There are 60 Questions in this booklet
2. All Question Carries some Marks which is shown on the right side of each
sections
3. All Question are Mandatory to answer with your consent
4. Nature of Questions are Objective, Conceptual, matching, fill in the blanks,
output based, code writing, error finding and code fillings
5. Read All Questions carefully before answer it
6. Answer Subjective Questions on Fresh Page
7. NO Negative Marking for wrong answer
8. Stepwise Marking are possible, provided at least Approach would be correct
9. Your Answer sheet will be graded by the course instructor
10. Feel Free to ask your examination controller if you think something wrong in the
question paper
11. Please do not disturb anybody during examination hours
12. After Examination is over submit entire credential(including Rough sheet ) to
invigilator
13. Please do not copy/lookup your collogue answer book otherwise your answer
sheet will not be graded and awarded 0 marks
14. Do not talk during examination hours
15. Your Examination Controller, Invigilators are:- Mr. Arun Kumar, Mrs. Ragini
Shukla and Mrs. Rangita Das Respectively
Name:____________________________________________________________
______
Father
Name:____________________________________________________________
_
Start Time: ________________________ End
Time______________________________
Student
Signature__________________________________________________________
Invigilator Signature ____________________
Date______________Time_____________
Objective
Questions
Which of the following is correct
output? 10x1= 10
1. void main(){
int x=100;
if(!!x)
printf(“x=%d”,!x);
else printf(“x=%d”,x);
a. 0
b. 2
c. 1.5
d. 100
2. void main(){
float a=0.5, b=0.9;
if(a&&b>0.9)
printf(“it is ur style”);
else
printf(“it is my style”);
a. it is ur style
b. it is our style
c. it is my style
d. no output
3. void main( ){
int x=10, y=20;
if(!(!x) && x)
printf(“x=%d”,x);
else
printf(“y=%d”,y);
a. 10
b. 20
c. 1
d. 0
4. void main(){
char ch=291;
printf(“%d%d%c”,32770,ch,ch);
a. 291
b. -32766 35#
c. 32770chch
d. 32770
5. void main (){
int a,b;
a = -3- -3;
b = -3 - - (-3 );
printf(“a=%d b= %d”,a,b);
}
a. a=0 b=-6
b. a=-3 b=+3
c. a=-6 b=+6
d. a=6 b=0
6. void main(){
int x;
x= -3 + 4 – 7 * 8 / 5 % 10;
printf(“x = %d”,x);
a. 23
b. 6
c. 7
d. 0
7. void main(){
int x=3, y=4, z=4;
printf(“ans = %d”, (z>=y>=x?100:200));
a. 100
b. 300
c. 200
d. No Output
8. void main( ){
int a=30, b=40, x;
x=(a!=10) && (b=50);
printf(“x= %d”,x);
a. 10
b. 50
c. 1
d. 0
9. void main( ){
float x=12.25, y=13.65;
if(x=y)
printf(“x and y are equal”);
else
printf(“x and y are not equal”);
a. x and y are not equal
b. x and y are equal
c. No output
10. void main (){
int i=1, j=1;
for(;j;printf(“%d%d\t”,i,j))
j=i++ <= 5;
a. 21 31 41 51 61 70
b. 21 30 41 50 61 70
c. 20 30 40 50 60 70
d. 21 31 41 51 61 71
What will be output:
10x1= 10
11.
void main(){
char far *p=(char far *)0x55550005;
char far *q=(char far *)0x53332225;
clrscr();
*p=25;
(*p)++;
printf("%d",*q);
getch();
}
12.
void main()
{
char i=13;
clrscr();
while(i)
{
i++;
}
printf("%d",i);
getch();
}
13.
void main()
{
int a=5,b=5;
clrscr();
if(b^a)
printf("EQUAL”);
getch();
}
14.
void main()
{
char a='\x82';
clrscr();
printf("%d",a);
getch();
}
15.
void main()
{
enum {a,b=32766,c,d,e=0};
clrscr();
printf("%d",a);
getch();
}
16.
#define char double
void main()
{
char a=9;
clrscr();
printf("%d",sizeof(a));
getch();
}
17.
void main()
{
int i;
struct arr1
{
int a[8];
};
struct arr1 p={1,2,3,4,5,6,7,8},q;
q=p; //copy in one line
clrscr();
for(i=0;i<8;i++)
{
printf("%d",q.a[i]);
}
getch();
}
18.
void main()
{
char arr[8]={'S','A','V','R','I','Y','A'};
char *p;
p=(char *)(arr+2)[2];
clrscr();
printf("%c",p);
getch();
}
19.
void main()
{
float a=5e4;
clrscr();
printf("%f",a);
getch();
}
20.
void main()
{
float a=5e40;
clrscr();
printf("%f",a);
getch();
}
Concept based
Questions 10x1=
10
21. What is the output of printf ("%d")?
22. What is the advantage of function pointer?
23. Can Structures be used with an Array?
24. What information does the header files contain?
25. Write a program to find out number of on bits in a number?
26. What is function pointer and where we will use it?
27. What is the difference between NULL & NUL keywords in C?
28. How many types of data structures are there?
29. Write code for initializing one dimensional and two dimensional arrays in a C
Program?
30. How does 'free' know how many bytes to free?
Fill in the
blanks
10x1= 10
31. ‘\014’ means in C language....................................................................
32. ‘\o’ means in C language ………………………………………………
33. Form Feed Represents in symbolic form in C language ………………
34. Putchar( c) is equivalent to …………………………………………….
35. Getc(stdin) is equivalent to …………………………………………….
36. Chmod 777 means……………………………………………………....
37. “try” and “catch” clause represent is a loop implies……………….........
38. “break” clause in a loop implies………………………………………...
39. For(;i<100;) implies loops terminate in…………………………………
40. “sleep()” and “wakeup()” command used in C language for…………….
Matching Type
Questions
10x1= 10
Mach Appropriate answers
41 20/3.0= a 1
42 3%2+2*9.0= b 100
43 Int(sqrt(2))= c helloworld
44 int i=3; Printf(%d,&i)= d 10
45 2.0/3+2.0/3+2.0/3+2/3 e 6.333
46 ASCII Value of @= f 14
47 Value of 12 on base 8 is= g 2.0
48 Value of 12 on base 12 is= h 19.0
49 A=”hello” ; B=”world”; strcamp(A,B)= i 3
50 A=”hello” ; B=”world”; strcat(A,B)= j 0
Subjective Questions
5x10= 50
51.
Find root’s of Quadratic Equation
ax +bx+c=0-------------------------------- (1)
2
Write C Program to calculate root of equation (1) based on input parameter’s a, b, c given
by the user, Also verify your solution’s with input parameter a=3,b=4,c=5
52.
Write a program to calculate Fibonacci Number 0,1,1,2,3,5,8,13,21……. By
definition Fibonacci is defined as
F(n)=F(n-1)+F(n-2); for all n>=2; and F(0)=0; F(1)=1
………… (2)
Take input parameter’s n from users and print in column format?
[Link] a program which will calculate Tower of Hanoi?
54. Write a program which will find out leap years of a calendar year?
55.
A Monkey would like to climb on a pole which has height H meter, in First minute they
climb x meter on the pole , in next minute they fall y meter on the pole, then find the time
taken by the monkey to climb on the pole? Write a C Program to calculate time taken by
the monkey in reaching on top of the pole? Take all parameters from users? Verify the
results with H=50 m, x=5m, y=2m
56. Write a program to convert Temperature (in Celsius) to Fahrenheit and vice versa?
All input taken from users? and verify the results with temperature T=40 C .
0
Temperature conversion formula is Tf = (9/5)*Tc+32; Tc = temperature in degrees
Celsius, Tf = temperature in degrees Fahrenheit
57. What is Bubble sort? How do you implement it with C Programming Language?
Write a Code to Sort N Numbers given in an Array A? Verify the results with
A=[3,4,1,2,9,4,20,33,42,22,33,44,10,4,2,3,56]
58. Which kind of output produce given below this program, suppose we enter N=56 ,
then which kind of input we get?
#include <stdio.h>
#include <conio.h>
int IsPrime( int );
int FindNextPrime( int );
int main()
int num,divisor = 2;
printf("Enter number:");
scanf("%d",&num );
printf("---------------------------------------------\n");
while( !IsPrime(num))
while(1)
if( num%divisor == 0 )
printf("%d\n",divisor );
num/=divisor;
break;
divisor = FindNextPrime( divisor );
printf("%d",num);
getch();
return 0;
//------ End of main() ------
int IsPrime( int num ) // Checks whether a number is prime
int i;
for( i=2; i<=num/2; i++ )
if( num%i == 0 )
return 0;
return 1;
int FindNextPrime( int num ) // Returns next prime number from passed arg.
do
if( num == 2 )
num++;
else
num+=2;
} while( !IsPrime(num));
return num;
}
59.
This Program Calculate GCD of two Numbers (The greatest common divisor of
integers x and y is the largest integer that evenly divides both x and y) Complete
blank part in this code so that it works nicely?
using System;
using [Link];
using [Link];
namespace exe_2_4
class Program
static void Main(string[] args)
int x, y;
[Link]("enter the value of x");
x = [Link]([Link]());
[Link]("enter the value of y");
y = [Link]([Link]());
---------------------------------------A(Fill Correct Code)
}
public static void gcd(int x, int y)
int z= --------------------------B (Fill Correct Code)
if (y == 0)
[Link]("the GCD({0},{1}) is {0}", x, y);
else
[Link]("the GCD({0},{1}) is ({1}, {2})", x,y, z);
60. Write a Program for printing reverse order numbers? For Example suppose
N=5662982, then your program should print 2892665?
_________________________________________________THE
END________________________________________
GOOD LUCK
Name:____________________________________________________________
______
Father
Name:____________________________________________________________
_
Start Time: ________________________ End
Time______________________________
Student
Signature_________________________________________________________
Invigilator Signature ____________________
Date______________Time____________