[go: up one dir, main page]

0% found this document useful (0 votes)
25 views6 pages

Question Bank FP-2

The document contains a series of questions and tasks related to programming concepts, particularly in C language, including flowcharts, data structures, functions, and file handling. It includes multiple-choice questions, true/false statements, and programming exercises. The content is designed to test knowledge of programming fundamentals and practical coding skills.

Uploaded by

prathamchamoli15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views6 pages

Question Bank FP-2

The document contains a series of questions and tasks related to programming concepts, particularly in C language, including flowcharts, data structures, functions, and file handling. It includes multiple-choice questions, true/false statements, and programming exercises. The content is designed to test knowledge of programming fundamentals and practical coding skills.

Uploaded by

prathamchamoli15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

1. Which symbol is used for condition check in Flowchart?

a) Rhombus b) Oval c) Rectangle d) Parallelogram

2. The Syntax to represent a 2-D array A[i][j] equals to

a) *(*(A+i) +j) b) *(*(A+j) +i) c) *(*(A+i+j)) d) *(j+(A+i))

3. int *ptr [10]; it represents

Array of Pointers b) Pointers of Pointer c) Pointers of Array

4. State whether the following statement is true or false.

strcmp() function counts and returns the number of characters in a string.

(a) True (b) False

5. State whether the following statement is true or false.

while loop is an entry-controlled loop.

(a) True (b) False

6. State whether the following statement is true or false.

break statement terminates the loop and takes the program control to the statement
immediately following the loop.

(a) True (b) False

7. State whether the following statement is true or false.

An array is a fixed-size sequenced collection part of elements of the same data type.

(a) True (b) False

8. State whether the following statement is true or false.

Structure and Union are user defined data type.

9. State whether the following statement is true or false.

int **p; It represents pointer of a pointer.

10. What will be the output of c in the following code?

char str [10] =” AA”, str1[10] =”BB”;

strcmp (str, str1) will return

a) 66 b) -1 c) 1 d) 65

11. A function which calls itself is called a ___ function.

a) Self Function

b) Auto Function
c) Recursive Function

d) Static Function

12. What is the output of the following code?

#include<stdio.h>

int func(int m)

int s=0,i;

for(i=0;i<=m;i++)

s+=i;

return s;

int main()

int a = 5,b;

b=func(a);

printf("%d",b);

return 0;

a) 5 b) 15 c) 20 d) None of these

13. Structures contain heterogeneous data types. [ T/F] Tick the correct one.
14. What is the output of the following block:
#include <stdio.h>
void solve() {
int ch = 2;
switch(ch) {
case 1: printf("1 ");
case 2: printf("2 ");
case 3: printf("3 ");
default: printf("None");
}
}
int main() {
solve();
return 0;
}
a. 1 2 3 None
b. 2 3 None
c. 2
d. None
15. Which of the following are correct file opening modes in C?
a. r
b. w
c. rw
d. All of the above

16. What will be the output of the following code?

#include<stdio.h>

int func(int m)

if(m == 1)

return 1;

else

return 2+func(m-1);

int main()

int a = 4, b;

b=func(a);

printf("%d",b);

return 0;

a) 3 b) 4 c) 7 d) 8

17. What will be the output of a and b after these codes

int a=5, b=6;

a=a^b; b=a^b; a=a^b;

A) a=6,b=5 B) a=5,b=6 C) a=5,b=5 D) a=6,b=6

18. What are the types of functions in C Language?


a) Library Functions

b) User Defined Functions

c) Both Library and User Defined

d) None of the above

19. Which of the following is the collection of different data types?


a. Array
b. String
c. Structure
d. All of the above
20. What is the output of the following code?

#include<stdio.h>

int main()

int a = 10;

int *p;

p=&a;

printf("%d",*p+8);

return 0;

a) 10 b) 18 c) Compilation error d) None of these


21. How many times will the following loop execute?
for(j = 1; j <= 10; j = j-1)

a. Forever
b. Never
c. 0
d. 1
22. Let p1 and p2 be integer pointers. Which one is a syntactically wrong statement?
a. p1 + p2;
b. p1-9;
c. p1+9;
d. p1-p2;

23. What will be the output of the following code?

#include<stdio.h>

int main()

{
int a[4] = {10,8,12,23};

int *p;

p=&a[0];

printf("%d %d",*(p+2),*(p+3));

return 0;

a) 10 8 b) 8 12 c) 12 23 d) 12 12

24. How is the 3rd element in an array accessed based on pointer notation?
a. *a+3
b. *(a+3)
c. *(*a+3)
d. &(a+3)

25. FILE *fp; ftell(fp) will give the ………………position of the file. Fill in the blanks.
26. int main (int argc, char *argv []) is the syntax to represent …………………Fill in the blanks.
27. What is the if…..else statement?
28. What is the relationship of algorithm with program?
29. Draw a flowchart to reverse of an inputted number.
30. Draw a flowchart to compute highest common factor between two inputted positive numbers.
31. What are looping instructions in C?
32. Explain break and continue statements.
33. Define a string with an example.
34. Write an algorithm to find the sum of n numbers where n is input by user.
35. Write a C program taking a function that will calculate multiplication of three integers.
36. Write a C program to read from a text file.
37. What is a structure?
38. Differentiate between array and ordinary variable.
39. State the major differences between Array and Structure?
40. What is the difference between Structure and Union?
41. What is Random Access?
42. Write a Program in C to add two matrices and display result.
43. What is recursion in C?
44. What is a return statement in a function?
45. What is the advantage of using functions in C?
46. What are character arrays?
47. What is the difference between actual arguments and formal arguments?
48. What is the work of fprintf() function?
49. What is the default label in a switch statement?
50. What is a structure pointer?
51. What are caller and callee function in C?
52. Explain Pass by value and Pass by reference with example in function.
53. What does the strlen () and strcmp () string function perform?
54. What is the difference between malloc() and calloc()?
55. Write a C program to search an integer in an array.
56. Write a C program to store record of 10 students in a structure. The student record has name, roll
number and marks obtained in programming.
57. Write a C program to find the first 10 fibonacci numbers.
58. How do you access structure members?
59. Write a C program to show dynamic memory allocation.
60. Implement a structure Student that contains name, roll number and marks obtained and determine
the grade and generate the marksheet.
61. Write a Program in C to check whether given string is palindrome or not.
62. Write a C program to check if the number entered from the keyboard is a prime number.
63. Write a C program to demonstrate the use of gets() and puts() functions.
64. Write a Program in C to read and display along with copy the contents of a file to another file.
65. Write down the recursive code to compute factorial of an integer n.

You might also like