0% found this document useful (0 votes)
25 views

Programming in C Question Bank

Uploaded by

okjsv17
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 views

Programming in C Question Bank

Uploaded by

okjsv17
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/ 11

SoCSE

Question Bank - Unit no.: I


Program: BCA
Course Name: Introduction to Programming Course Code: 21BCA102/21BSIT102
Academic year: 2022-23 Sem/Year: I / 1
Level A. Easy Questions (2 marks each)
S. Questions
CO*
No.
Q1 What do you mean by computer language? Also explain low and high level CO1
language
Q2 Discuss about the main elements which are included in the ‘c’ program? CO1
Q3 What do you mean by data type? CO1
Q4 What do you mean by top down approach, bottom up approach? CO1
Q5 How can you store the values in ‘c’? Explain with example. CO1, CO2

Q6 Write short note on Identifier. CO1, CO2


Q7 Mention the restrictions to be followed during the creation of user defined CO1, CO2
identifiers.
Q8 Differentiate between user defined identifiers and variables. CO1, CO2
Q9 What do you mean by modifiers? CO2
Q10 Discuss the concept of type qualifiers. CO2
Q11 Write algorithm/program to calculate the simple interest. CO1, CO2
Q12 With the help of an example demonstrate the extrinsic type casting. CO2
Q13 Differentiate between logical and syntactical error. CO1, CO2
Q14 Write algorithm/program to find the sum and average of three numbers. CO1, CO2
Q15 What is a constant? Explain with an example. CO2
Q16 What is algorithm? CO1
Q17 Discuss about the features of algorithm. CO1
Q18 What is the escape sequence? CO2
Q19 Evaluate the expression 2+3*3-7+10-5/4+3 using operator precedence CO2

Q20 With the help of an example show the working of bitwise operator. CO2
Level B. Intermediate Questions (5 marks each)
Q21 What are the storage classes in ‘c’? Mention the types and explain with examples. CO2

Q22 Describe the precedence and order of evaluation of operations of different CO2
operators.
Q23 Differentiate between intrinsic and extrinsic type casting. CO2

Q24 Write an algorithm/program to check whether the entered number is even or CO2
not.
Q25 Discuss about the various types of statements in ‘c’. Explain with example. CO2

Q26 What is the purpose of scanf() and printf() statement ? CO2

Q27 Convert the following mathematical expression into C equivalent CO2


i) area= s(s-a)(s-b)(s-c)
ii) ii) x = -b + b2 -4ac
Q28 Discuss about the working of unary operators with suitable example. CO2

Q29 With help of an example explain the working of logical operator. CO2

Q30 Write an algorithm/ C program in C to find the area and perimeter of a rectangle CO2

Level C. Difficult Questions (10 markseach)


Q31 List down the operators available in ‘c’? Explain with example. CO2

Q32 Type casting is an important part when doing the operations on numeric values. CO2
Justify your answer with suitable example.
Q33 Write a program in ‘C’ to enter the basic salary of the employee, calculate DA at CO2
15 %, TA at 25 %, HRA at 25 %,then calculate pay given to the employee.
Q34 Write a program in ‘C’ to take two numbers as input and print the sum, CO2
difference, division, multiply of these numbers.
Q35 Accept the marks in five subjects and marks obtained and percentage of marks. CO2

Q36 Explain the block structure of a C program. CO2

** Note: Students to be instructed to draw well labeled diagrams


wherever necessary, to support their answers (especially in level B
and C questions)
Question Bank - Unit no.: II
Program: BCA
Course Name: Introduction to Programming Course Code: 21BCA102
Academic year: 2022-23 Sem/Year: I / 1
Level A. Easy Questions (2 marks each)
S. Questions
CO*
No.
Q1 Classify the different types of decision making statements. CO2

Q2 Write the syntax for nested if and else-if ladder? CO2

Q3 Write a program to check whether the person is eligible to vote. CO2

Q4 Write and explain syntax of ―for‖ loop. CO2

Q5 Distinguish between while and do-while statements. CO2

Q6 Write a program to print the multiplication table of n? CO2

Q7 Differentiate between break and continue. CO2

Q8 Define goto with an example. CO2

Q9 Define exit and return statements. CO2

Q10 List down the advantages of using loops. CO2

Q11 Differentiate between conditional and unconditional jump statement. CO2

Q12 Elaborate the every element included in the for loop. CO2

Q13 Explain the use of continue statement with the help of examples. CO2

Q14 Explain infinite loop. CO2

Q15 Explain the use of break in switch statement. CO2

Q16 What is the use of compounding of statements? CO2

Q17 Compare ternary operator and if..else. CO2

Q18 Show the steps of execution of while loop. CO2


Q19 Write a C program to calculate the factorial of a given number. CO2

Q20 Distinguish between break and exit statements. CO2


Level B. Intermediate Questions (5 marks each)
Q21 What is a nested loop? Write a program to generate n Fibonacci numbers. CO2

Q22 Write a program to find the sum of even and odd numbers from 1 to n. CO2

Q23 Explain else-if ladder with the help of flowchart and program. CO2

Q24 Write a program to find sum of the individual digits of a given number. CO2

Q25 Write a program to display the following pattern. CO2


*****
****
***
**
*
Q26 Write a program to generate prime numbers between 1 to n. CO2

Q27 Write a C program to find the factorial of a number using do-while ,where the CO2
number n is entered by user.
Q28 Write a program to check whether the given number is palindrome or not. CO2

Q29 What is switch case? Discuss the restrictions on the switch case? CO2

Q30 Develop a C program to accept a number n and print sum of all even digits and CO2
multiplication of odd digits.
Level C. Difficult Questions (10 markseach)
Q31 Explain various branching statements in C with examples. CO2

Q32 Write a Program to perform arithmetic operations using switch. CO2

Q33 List and explain unconditional statements in C with examples. CO2

Q34 Compare the use of the switch statement with the use of nested if-else. CO2

Q35 Develop a C program to convert a binary number to a decimal number. CO2

Q36 Develop a C program to evaluate the expression: CO2


1/x – 1/x2 + 1/x3 – 1/x4………………..
** Note: Students to be instructed to draw well labeled diagrams
wherever necessary, to support their answers (especially in level B
and C questions)
Question Bank - Unit no.: III
Program: BCA
Course Name: Introduction to Programming Course Code: 21BCA102
Academic year: 2022-23 Sem/Year: I / 1
Level A. Easy Questions (2 marks each)
S. Questions
CO*
No.
Q1 What is an array? Write the types of an array. CO3
Q2 Discuss the concept of recursion? CO2,
CO3

Q3 List down the advantages of function. CO3

Q4 What is a function? Write the types of functions. CO3

Q5 How to declare and initialize 1-D, 2-D array with an example. CO3

Q6 Write a C program to find the largest element given in an array of elements. CO3

Q7 Distinguish between Actual and formal arguments CO3

Q8 Explain the concept of searching. CO3

Q9 Distinguish between Global and local variables CO3

Q10 Explain the syntax of function in C programming. CO3

Q11 Differentiate between actual and formal argument. CO3

Q12 Distinguish between Automatic and static variables CO3

Q13 Develop a C function which return the length of the string, without using string CO3
library functions.
Q14 Write a C program to print the smallest value in a given array along with its CO3
position in the array.
Q15 What are the built-in and user-defined functions? CO3

Q16 What are the advantages and Disadvantages of recursion? CO3

Q17 Discuss about the different categories of functions. CO3

Q18 Differentiate between linear search and binary search. CO3


Q19 Discuss about the scope of variables. CO3

Q20 State the purpose of the return statements? CO3


Level B. Intermediate Questions (5 marks each)
Q21 Explain String Manipulation functions with example? CO3

Q22 Explain about enumerated data types with example? CO3

Q23 Write a C program to sort the given array elements in Ascending order. CO3

Q24 How to declare and initialize a Two-dimensional array? Discuss with examples. CO3

Q25 Write a C program to illustrate call-by-value parameter passing technique. CO3

Q26 Develop a C program for Linear Search. CO3

Q27 Show the use of strcpy() and strcat() using an example. CO3

Q28 What is function prototype? CO3

Q29 Using a suitable example differentiate between printf() and puts(). CO3

Q30 Write a program to convert a lowercase string into uppercase. CO3

Level C. Difficult Questions (10 markseach)


Q31 Create a function to count the number of vowels in given string. CO3

Q32 Show the steps to search 38 among the given set of elements using binary search CO3
method:
12, 35, 8, 18, 38, 41, 19
Q33 Write a C program to multiply two matrices of different order. CO3

Q34 Explain the concept of recursion. Create a recursive function which return the CO3
factorial of a given number.
Q35 Using 2-D array, write a program to print the Pascal triangle. CO3

Q36 Using C language, write a program to generate the following output: CO3
Input : 2345
Output: Two Three Four Five
** Note: Students to be instructed to draw well labeled diagrams
wherever necessary, to support their answers (especially in level B
and C questions)
Question Bank - Unit no.: IV
Program: BCA
Course Name: Introduction to Programming Course Code: 21BCA102
Academic year: 2022-23 Sem/Year: I / 1
Level A. Easy Questions (2 marks each)
S. Questions
CO*
No.
Q1 Differentiate between the structure and union? Give examples. CO4
Q2 How the calloc() and malloc functions are used? Write a program using them CO4

Q3 Define pointer. How can you declare it? CO4

Q4 Compare pointer variable and normal variable. CO4

Q5 With the help of an example, show the passing of a pointer variable as argument. CO4

Q6 Write a C program to print address of a variable. CO4

Q7 Define Structure with in structure with an example CO4

Q8 Define how to copy the structure variables with example CO4

Q9 Differentiate between arrays and structures? CO4

Q10 Write a program in C to add two numbers using pointers CO4

Q11 Discuss the advantages of dynamic memory allocation over array. CO4

Q12 Explain the usage of * and & operators? CO4

Q13 Discuss about static variable. CO4

Q14 What is Macro variable? CO4

Q15 Explain the use of typedef keyword. CO4

Q16 Write a program to print the address and string using array of pointers to strings. CO4

Q17 How a function can return more than one value? CO4

Q18 Write a program to swap two values without using third variable. CO4

Q19 Discuss the syntax of declaring an union variable. CO4


Q20 Discuss about the bitwise operator. CO4

Level B. Intermediate Questions (5 marks each)


Q21 Show the use of a structure with in a structure by giving an example. CO4

Q22 Explain different dynamic memory allocation/de-allocation functions of C with CO4


syntax and example.
Q23 How can a function return a pointer to its calling routine? CO4

Q24 Differentiate between static memory allocation & dynamic memory allocation. CO4

Q25 Discuss about the pointer arithmetic. What are the operations can be performed CO4
on pointer variables.
Q26 Discuss about the call by value and call by reference. CO4

Q27 Write a C program to show that pointer of any data type occupies same space. CO4

Q28 Define Structure and write the general syntax for declaring and accessing CO4
members.
Q29 How to copy and compare structure variables? Illustrate with example. CO4

Q30 How data elements are stored under unions, explain with example? CO4

Level C. Difficult Questions (10 markseach)


Q31 What is a structure? How is it different from an array? How are they defined and CO4
initialized? Explain with example.
Q32 Develop a C program to create an array of 10 integers using pointer and find the CO4
largest integer.
Q33 Write a C program to count the number of vowels, consonants, digits, spaces and CO4
special characters in a given string.
Q34 Write a C program that defines a structure employee containing the details such CO4
as empno, empname, department name and salary. The structure has to store 20
employees in an organization. Use the appropriate method to define the above
details and define a function that will display the contents?
Q35 Write a C program to count vowels and consonants in a string using pointer CO4

Q36 Define nested structure explain with in an example CO4

** Note: Students to be instructed to draw well labeled diagrams


wherever necessary, to support their answers (especially in level B
and C questions)
Question Bank - Unit no.: V
Program: BCA
Course Name: Introduction to Programming Course Code: 21BCA102
Academic year: 2022-23 Sem/Year: I / 1
Level A. Easy Questions (2 marks each)
S. Questions
CO*
No.
Q1 What are the Different file operations? CO5
Q2 Discuss about Sequential file handling functions? CO5

Q3 Discuss about different file modes? CO5

Q4 Define the syntax to declare a file in C? CO2,CO5

Q5 Define how to Open a file and give its syntax in C? CO2,CO5

Q6 Define fseek() function in C and write its syntax? CO3,CO5

Q7 Define the usage of fprintf() in C? CO3,CO5

Q8 Define the usage of fscanf() in C? CO3,CO5

Q9 What is preprocessor? CO2,CO3,


CO5

Q10 Discuss about that may occur in opening a file. CO3,CO5

Q11 Explain the concept of buffer in aspect FILE concept. CO5

Q12 What is meant by linking process? CO5

Q13 What are two main ways a file can be organized? CO5

Q14 Write short notes on fseek(). CO3,CO5

Q15 Write short note for ftell(). CO3,CO5

Q16 Write short notes on fread(). CO3,CO5

Q17 Why do we use header files? CO5

Q18 Write about Random file handling functions? CO5


Q19 Explain the following preprocessor directives #define CO5

Q20 Write about different error handling functions on files? CO5


Level B. Intermediate Questions (5 marks each)
Q21 Write a C program to display the contents of the file in reverse order. CO3,CO5
Q22 Write a C program to copy the contents from one file to another file. CO2,CO5
Q23 Discuss command line arguments in detail with examples. CO2,CO5

Q24 Explain the concept of enumeration with an example. CO2,CO5

Q25 Write a program to read and write a block onto a file. CO2,CO5

Q26 Discuss about fgets() and fputs(). CO3,CO5


Q27 Explain Macro Substitution with examples. CO3,CO5
Q28 Explain the Operations associated with the concept of FILE. CO3,CO5
Q29 Compare sequential access and random access. CO3,CO5
Q30 Write a C program to read name and marks of n number of students from user CO3,CO5
and store them in a file.
Level C. Difficult Questions (10 markseach)
Q31 Write a C program to count number of characters, spaces, lines, words of a file. CO2,
CO3,CO5
Q32 Write a program in C that reads the name of a file and displays the contents of CO2,
the file on the user screen. CO3,CO5
Q33 Explain about files and with it types of file processing. CO5
Q34 Write a C program to write all the members of an array of structures to a file CO2,
using fwrite(). Read the array from the file and display on the screen. CO3,CO5
Q35 Write a C program to Open a File, read from it, And Close the File CO2,
CO3,CO5
Q36 Discuss, how a file can be opened in different modes. CO5

** Note: Students to be instructed to draw well labeled diagrams


wherever necessary, to support their answers (especially in level B
and C questions)

You might also like