Assignment Questions For C Programming-1
Assignment Questions For C Programming-1
UNIT 1
1. Define a computer system. What are its main components Also draw the block
diagram?
2. Explain the difference between primary memory and secondary memory with
examples.
3. What is the role of the CPU (Central Processing Unit) in a computer system?
4. List and briefly describe any four input/output (I/O) devices with brief explanations of
each.
5. What is the purpose of storage devices in a computer system? Name any two storage
devices.
6. Define an assembler. What is its role in computer programming?
7. Differentiate between a compiler and an interpreter. Explain any four differences
8. Explain the functions of a loader and a linker in the process of executing a program.
9. What is an algorithm? Why is it important in problem-solving?
10. Describe the purpose of a flowchart in algorithm representation.
11. Explain what a pseudo code is, and how it is used in programming.
12. What are the basic components of a C program?
13. Describe the steps involved in writing and executing a C program.
14. What is the difference between syntax errors and logical errors in C programming?
15. Define variables in C. How are they related to memory locations?
16. Write a c program to find the sum and average of a three numbers provided by
the user.
17. Explain printf and scanf functions with example.
18. Explain about standard input/output header files in C.
19. Write a C program to find the greatest among three numbers provided by the
user.
20. Write a program to swap the values of two variables with and without using the third
variable.
UNIT 2:
Arithmetic Expressions and Precedence
1. What is operator precedence, and how does it affect the evaluation of an expression
involving both multiplication and addition? Provide an example.
2. Explain how the relational operators (<, >, ==, etc.) are used in expressions. Provide an
example with a numeric comparison.
3. Describe how implicit type conversion works in an expression involving both an
integer and a floating-point number.
4. What is the difference between the logical AND (&&) and logical OR (||) operators?
Provide an example to illustrate your answer.
5. Explain how the bitwise OR (|) operator works on numeric values. Provide a simple
example with binary numbers.
6. How does the assignment operator (=) work in an expression involving arithmetic
operations? Provide an example to explain your answer.
7. What role does associativity play when evaluating an expression with multiple
operators of the same precedence? Illustrate with an example.
8. Describe how mixed operands (e.g., integer and character) are handled in an
arithmetic expression. Provide an example.
Conditional Branching
9. How does the else if construct help in evaluating multiple conditions in an if-else
structure? Provide a brief code example.s
10. What is the purpose of the default case in a switch statement? Give an example to
explain its use.
11. Explain how nesting of if-else statements can be used to evaluate complex conditions.
Provide an example.
12. What happens when there is no break statement in a switch case? Illustrate with a
simple code.
13. Explain the main difference between a for loop and a while loop. When would you
prefer one over the other?
14. How does the continue statement alter the flow of a loop? Provide an example to
explain its effect.
15. Describe a situation where a goto statement might be used in a loop. Why is its use
generally discouraged?
16. Write a program to find whether a person is eligible for voting or not?
17. Write a C program to print the odd and even number from 1 to 10.