2020 - BCA 2 Sem Programming Through C-IISem-BCA2CC08
2020 - BCA 2 Sem Programming Through C-IISem-BCA2CC08
Subject: BCA
Paper name: Programming Language Through C
Paper No: BCA/2/CC/08
Semester: II Semester
9. What is Sizeof()
a) Function
b) Macro
c) Operator
d) Preprocessor
11. Which of the following escape sequence is used to move the cursor to the next line on the
screen
a) \t
b) %d
c) \l
d) \n
17. Whats wrong in the following statement, provided k is a variable of type int
For (k=2, k<=10,k++)
a) The variable k should be 0
b) There should be a semicolon at the end of the statement
c) The variable must always be the letter i
d) The comma should be a semicolon
d) BCA BCA
20. In the following loop construct, which one is executed only once always.
for(exp1; exp2; exp3)
a) exp1
b) exp2
c) exp3
d) none of the above
a) if (funct(a)){}
b) if(if(a==4)){}
c) if(a){}
d) none of the above
}
while(i<=35);
}
a) 36
b) 35
c) 36 35
d) 35 36
a) 8 3
b) 8 5
c) 3 8
d) 5 3
43. Which of the following statements are correct about the function
long fun(int num)
{
int i;
long f=1;
for(i=1; i<=num; i++)
f = f * i;
return f;
}
a) Function calculate the value of 1 raise to power number
b) Function calculate the square root of an integer
c) Function calculate the factorial of an integer
d) None of the aove
44. In C, if you pass an array as an argument to a function, what actually gets passed?
a) Value of an elements in array
b) First element of the array
c) Base address of the array
d) Address of the last element of the array
53. A pointer is
a) A keyword used to create variables
b) A variable that stores address of other variable
c) A variable that stores address of an instruction
d) All of the above
b) an error message
c) a x address of b
d) a x address a
64. Which of the following are themselves a collection of different data types?
a) char
b) String
c) Structure
d) All of the above
67. Which of the following are incorrect syntax for pointer to structure?
(Assuming struct temp{int b;}*my_struct;)
a) *my_struct.b = 10;
b) (*my_struct).b = 10;
c) my_struct->b = 10;
d) Both *my_struct.b = 10; and (*my_struct).b = 10;
68. The correct syntax to access the member of the ith structure in the array of structures is?
Assuming:
struct temp
{
int b;
}s[50];
a) s[i].b;
b) s.[i].b;
c) s.b.[i];
d) s.b[i];
71. If there is any error while opening a file, fopen will return?
a) Null
b) EOF
c) Nothing
d) 0
FILE *fp;
fp=fopen("demo.txt","r");
while((c=fgetc(fp))!=EOF)
printf("%c",c);
fclose(fp);
return 0;
}
a) It will print the content of file till it encounter new line character
b) It will print the content of file demo.txt
c) Compilation Error
d) None of the above
Key Answers
1. a) 2. c) 3. d) 4.a) 5. d) 6.c) 7. a)
1. Dennis Ritchie
2. 32
3. Bitwise
4. Continue
5. Break
6. float
7. Recursive
8. return
9. Variable function
10. Same data type
11. Compile time
12. Ampersand(&)
13. .
14. output stream
15. Struct type