Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
4 views

Programming in C Question Bank

The document is a question bank focused on programming in C, covering fundamental concepts such as programming languages, data types, control structures, and functions. It includes a variety of questions ranging from theoretical explanations to practical programming tasks, such as writing pseudocode and C programs for specific operations. The content is designed to assess knowledge and skills in C programming and the program development cycle.

Uploaded by

dj386303
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Programming in C Question Bank

The document is a question bank focused on programming in C, covering fundamental concepts such as programming languages, data types, control structures, and functions. It includes a variety of questions ranging from theoretical explanations to practical programming tasks, such as writing pseudocode and C programs for specific operations. The content is designed to assess knowledge and skills in C programming and the program development cycle.

Uploaded by

dj386303
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

PROGRAMMING IN C QUESTION BANK

1. What is a programming language, and why is it used?

2. Name any two types of programming languages.

3. What is the first step in the program development cycle?

4. What does a compiler do during program execution?

5. Write the pseudocode to calculate the sum of two numbers.

6. Name three common symbols used in flowcharts and their purposes.

7. What is a variable in C programming?

8. What is the difference between a variable and a constant in C?

9. What is the symbol for the logical AND and


10. bitwise AND operator in C?
11. Which loop in C guarantees execution at least once, even if the condition
is false?
12. Write a program to add two arrays (2D) and display the result

13. Write a C program to check if a given number is a prime number using a


for loop and an if statement
14. Write a C program using a switch statement to display the name of a day
based on a number entered by the user (1 for Monday, 2 for Tuesday,
etc.).
15. Explain the difference between primitive data types and derived data
types in C. Provide examples of each.
16. Describe the basic structure of a C program, including the roles of the
#include directive, main() function, and statements within the program.
17. Discuss the difference between formatted and unformatted input/output
functions in C with examples of scanf, printf, getchar, and putchar.
18. What is the difference between the if-else and if-else if statements in C?
Provide a scenario where you would use if-else if.
19. What is the purpose of variable declaration in C? Explain with an
example of declaring and initializing a variable.
20. How are symbolic constants defined in C using the #define preprocessor
directive? Provide an example.
21. Compare and contrast the while, do-while, and for loops in C. When
would you use each loop in different programming scenarios?
22. Draw a flowchart to find the sum of the first 10 natural numbers.
23. What are the basic steps of the program development cycle?

24. Name any five keywords in C.

25. What is procedural programming, and how does it differ from object-
oriented programming?
26. Write a pseudocode to calculate the factorial of a number.

27. Explain the role of a compiler in program execution.

28. What is the significance of identifiers in C programming?

29. Draw the flowchart symbol used for input/output operations.

30. Differentiate between a while loop and a do-while loop in C.

31. What are the key features of high-level programming languages?

32. What is the difference between a constant and a variable in C?

33. Explain the different types of programming languages with examples, and
discuss how they have evolved over time.
34. Write a pseudocode and draw a flowchart for a program that calculates
the factorial of a given number.
35. What is an Integrated Development Environment (IDE)? List its
components and explain its role in program development.
36. Discuss the various data types in C. Provide examples of variable
declarations using these data types.
37. Write a C program to read two integers from the user and perform the
following operations: addition, subtraction, multiplication, division, and
modulus. Display the results using formatted output.
38. Write a C program to find the largest of three numbers entered by the user
using nested if-else statements.
39. Explain the difference between call by value and call by reference with
suitable programs

40. Discuss the role of standard input and output functions (printf, scanf,
getchar, putchar) in C. Write a program to read a string, an integer, and a
floating-point number from the user and display them in a formatted
output.

41. What are library functions in C? Categorize them (e.g., string, math,
input/output, and utility functions) and write a program that uses math.h
functions (pow, sqrt, and fabs) to solve a quadratic equation.
42. Compare the if-else and switch statements in C. Write a program to 44.
classify a character as a vowel, consonant, digit, or special character
using both constructs.

43. Explain the differences between for, while, and do-while loops in C. Write
a program to find the factorial of a given number using a while loop.

Sum of Natural Numbers (Using for loop):


Write a program to calculate the sum of the first n natural numbers.
(Example Input: n = 5, Output: Sum = 15)
45. Reverse a Number (Using while loop):
Write a program to reverse a given number.
(Example Input: 1234, Output: 4321)
46. Factorial of a Number (Using while loop):
Write a program to find the factorial of a given number.
(Example Input: 5, Output: 120)
47. Prime Numbers in a Range (Using for loop):
Write a program to print all prime numbers between 1 and 100.
(Example Output: 2, 3, 5, 7, ... 97)
48. Check Palindrome (Using while loop):
Write a program to check if a given number is a palindrome.
(Example Input: 121, Output: Palindrome)
49. Guess the Number Game (Using do-while loop):
Write a program where the user has to guess a randomly generated number (1-100). The
program should repeatedly ask the user for a guess until the correct number is entered.
(Example Input: 50, 75, Output: Congratulations, you guessed it!)
50. Multiplication Table (Using for loop):
Write a program to display the multiplication table of a given number.
(Example Input: 3, Output: 3 x 1 = 3, 3 x 2 = 6, ...)

You might also like