0% found this document useful (0 votes)
40 views3 pages

Practice Questions

The document consists of a list of practice questions related to C and C++ programming concepts. It covers topics such as basic data types, control structures, functions, arrays, structures, file handling, and object-oriented programming principles. Each question prompts the reader to write programs or explain concepts, providing a comprehensive overview of programming skills in C and C++.

Uploaded by

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

Practice Questions

The document consists of a list of practice questions related to C and C++ programming concepts. It covers topics such as basic data types, control structures, functions, arrays, structures, file handling, and object-oriented programming principles. Each question prompts the reader to write programs or explain concepts, providing a comprehensive overview of programming skills in C and C++.

Uploaded by

jaindaksh027
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Practice Questions

1 Write a note on basic data types in C

2 C program using if statement to find whether number is positive, negative or Zero


3 C program using for loop to print Fibonacci series. The number of terms shall be
accepted from user.
4 Explain working of multi decision making statement in C.
5 Write a note on keyword with example
6 C program to accept 2 numbers from user and one operator. Based on operator given
perform addition, subtraction, multiplication or division. (use switch)
7 C program to print multiplication table using for loop.
8 Examine working of if-else ladder by giving suitable example.
9 What is header file and state the purpose of various header files
10 C program to accept a character from user and check whether it is Vowel or
Consonant using switch
11 Construct a C program using for loop to print sum of first 10 numbers
12 Explain working of if –else ladder with example
13 C program to print addition of all odd /even numbers
14 Write a C program to check whether a character entered by user is in Small case,
Upper case or special character
15 Write a C program to print sum of first 10 numbers
16 Explain top tested and bottom tested loop
17 Write a C program that allows users to convert temperatures between Celsius and
Fahrenheit
18 Explain working of for loop/while loop/do-while loop
19 Summarize various advantages of functions.
20 Demonstrate the working a C program using function to print factorial of a number.
Example: 5! = 5 X 4 X 3 X 2 X 1 =120
21 Develop C program to count the occurrences of 'a' in a String.
If string is “apple” then output should be 1.
22 Construct a C program to accept 3X3 matrix from user and to print diagonal elements
/upper triangular/ lower triangular elements of matrix
23 Explain following with respect to functions
 Function definition
 Function Declaration,
 Function Call
24 Demonstrate the working of following functions
 sqrt()
 pow()
 fabs()
 ceil()
 floor()
 Strcmp()
 Strlen()
 Strcat()
 Strrev()
 Strstr() etc.
25 Develop C program to count the number of Vowels in the string given.
Example if string is “college” then output shall be 3.
26 Construct a C program to accept 3X3 matrix from user and to print transpose of
matrix.
27 Summarize working of an array (3X3)
28 Explain what do you mean by built in function
29 Demonstrate the working of any of user defined function in C
30 Develop C program to count the number of characters in string without using string
function
31 C program to print addition of 2 matrix
32 C program to add all elements of matrix
33 State advantages of functions
34 Find the Sum of Array Elements in one dimensional array
35 Write c program using function to print Mini of 2 numbers
36 write a program to Find the Largest Element in an one dimensional Array
37 Develop a C program to read a file called “[Link]” and print contents of it.
38 Demonstrate the working of structure by creating a C program with structure name
employee and fields as employee_id, name, salary. Accept data from user and print
the same.
39 Explain the working of pointer with suitable example.
40 explain working of malloc() ,calloc() and free()
41 Compare constructors and destructors in C++.
42 Construct a C program to read a file called “[Link]” and print contents in encrypted
form.
43 Demonstrate the working of structure by creating a C program with structure name
student with rollno, name, marks1, marks2. Find total and print average of marks 1
and marks2.
44 Illustrate working of c program to swap 2 numbers using call by reference method.
45 Explore the concept of Inheritance in C++ along with types of inheritance.
46 Design C++ program to create class called bank with fields account number, name
and type of account, balance. Create one object to test the functionality of class bank.
47 Develop a C program to copy contents of one file to another file
48 Demonstrate the working of structure by giving suitable example.
49 Explain the concept of class and object in C++ with example.
50 Demonstrate working of malloc() and free().
51 Compare Inheritance and Polymorphism in C++.
52 What are the basic file handling operations in C provide functions
53 How do you count the number of characters in a file? Provide program
54 C Program to Generate a Shopping Bill Using Structures
55 Compare structure and union
56 Write c program to structure to print max salary of employee
57 Why do we need files in C?
58 explain the importance of structure
59 Advantages of pointer
60 Write a c program using pointers to reverse one dimensional array
61 explain working of call by reference with example
62 Explore the concept of Inheritance in C++ along with types of inheritance. [hint :
Single Inheritance , Multilevel Inheritance, Hierarchical Inheritance

63 Create a class Teacher with fields (Tid, name, qualification, no of lects taken, rate per lect)
Accept details from user .
Find how many lectures are conducted.
To find salary of teacher = lects * rate
Use C++
64 Function to calculate area of circle/rectangle/square
65 Explain various OOPS with examples.
66 Note on array of pointer / example
67 Compare pointer and array
68 Write features of programming languages
69 State working of one dimensional array
70 Write C program to check whether matrix 3X3 is sparse matrix or not.
71 write C program to read one dimensional array of integers and replace with 0 if value is
==1.

You might also like