Beruflich Dokumente
Kultur Dokumente
Applied Sciences
Department of Computer and Information Sciences
Subject Title
Date
07-Nov-2016
Subject Code
CIS-101
Time
0845
class
Duration
90 min
Student Name
Roll No
Section-I
Time 10 Min, Marks-15
Solve on the answer sheet provided with this section, time for this section is 10 min
Q1. Choose the correct option
1. A variable is a __________ in memory, it has a _____________ and ____________
a. location, name, address
b. box , name , value
c. number , name, address
d. file, name, value
2. C/C++ is a _____________ level language in comparison to machine language which is
a ______________
a. Low , Programming
b. High, Low
c. Low, High
d. Intermediate Level, High
3. The program that translates code from text to machine language is called
a. IDE
b. Assembler
c. Translator
d. Compiler
4. To store number 456 the computer will need ___________ bits or _________ bytes
a. 16,2
b. 8,1
c. 9,2
d. 10,3
5. int a1, for, 4d, total_marks; in these variables which of the variable/s declaration is
incorrect
a. a1
b. a1 , total_marks
c. for , total_marks
d. for, 4d
6. Which of the following statement is correct
a. The elements of an array always occupy contiguous memory locations
Section-II
Solve on question paper, return solved paper to examiner, time for this section is 40
min
Q2-Write output of the following programs, (The header files are not
included here, you should not consider it as mistake or error)
Marks[4x5=20]
Program-1
Output
Program-02
void main (){
Output
int A=21403,index,a,c;
int B[5]={10,20,30,40,50};
a=A;
for(index=4;index>=0;index--){
c=a%5;
printf("value : %d \n",B[c]);
a=a/10;
} }
program-03
Output
Program-04
void main(){
int x=30,y=10,z=20,temp;
Output
if(x>y){
temp=x;
x=y;
y=temp;
if(y>z){
temp=y;
y=z;
z=temp;
}
}
printf(" Values of x,y,z are x=%d, y=%d, z=%d", x, y, z);
}
Program-05
int main(){
int number[4]={7887,7878,7788,8778};
inta,b,index,temp;
for(index=0;index<4;index++){
b=number[index];
while(b>=10){
temp=temp%10;
b=b/10;
}
a=number[index]%10;
if(a==b)
printf(\nThe number is balanced);
else
printf(\nThe number is not balanced);
}}
Output
Section-III
Q3-For the following loops indicate how many x will be printed
Marks[2x5=10]
Problem-01
int index=1;
while(index<=100){
if(index%2==0)
index=index+2;
printf(x);
j=j+2; }
if(j%5==0)
printf(x);
Answer
else
index=index+1;
printf(x);
}
Problem-04
int j=0,k=0;
while(k!=0){
Answer
printf(x);
j++;
Problem-02
int i;
k=j;
}
for(i=5;i>=1;i=i-1)
Answer
printf(%d,i);
printf(x);
Answer
Problem-05
int i, k=0;
while(k<100){
Program-03
int j=2;
if(j%2==0){
printf(x);
j=j+1;
}
if(j%3==0){
for(i=1;i<10;i=i+1)
printf(x);
k=k+i;
}
Answer
Date
07-Nov-2016
Subject Code
CIS-101
Time
0845
class
Duration
90 min
Student Name
Roll No
Sr.No.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Answer (a, b, c or
d)
15
____________________
Signature of Student