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

Programming in C Question Bank

Uploaded by

ajay jha
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)
17 views3 pages

Programming in C Question Bank

Uploaded by

ajay jha
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
You are on page 1/ 3

IILM University Greater Noida, Uttar Pradesh

School of Computer Science and Engineering


Course Name: Programming in C
Course Code: UCS1003
Question Bank (Unit-1 and Unit-2)

1. Differentiate between an Interpreter, Compiler and an Assembler.


2. Explain the different components of a computer system (Memory, Processor, Input and
Output devices, Storage, Operating System) with suitable examples.
3. Explain Loader and Linker with suitable diagram.
4. Define an algorithm and its features. Explain any two methods of algorithm
representation with examples.
5. Discuss the process of converting an algorithm into a C program using the following
stages:
a. Writing pseudo code
b. Drawing a flowchart
c. Writing source code in C.
6. Represent the algorithm for checking whether a number is even or odd using a
flowchart.
7. Draw a flowchart to find whether a given number is positive, negative or zero.
8. List all the fundamental data types in C and their typical sizes.
9. Write a C program that computes the size of int, float, double and char.
10. Make the hierarchy of different memories available in the computer.
11. Explain source file, header file, object file and executable file.
12. What is the output of this C code?
#include<stdio.h>
int main()
{
float x = 'a';
printf(""%f"", x);
return 0;
}

13. What is the difference between variable declaration and variable definition?
14. Differentiate between the Operator "=" and "= =" in C.
15. Differentiate between a while loop and a do-while loop.
16. Describe the purpose of a switch statement in programming?
17. Write C code to print first 10 numbers.
18. Write a simple if statement in C to check if a number is positive.
19. Write any three differences between Application software and System software?
20. Differentiate the use of break and continue statements.
21. Write a C program to print all even numbers between 1 and 50 using a for loop. Use the
continue statement to skip odd numbers. Explain how the continue statement affects
the flow of the loop.
22. Consider the following C program. What is the Value of a?

#include<stdio.h>
int main()
{
int a=7, b=5;
switch (a = a % b)
{
case 1:
a = a - b;
case 2:
a = a + b;
case 3:
a = a * b;
case 4:
a = a / b;
default:
a = a;
}
return 0;
}
23. Write the difference between unary and binary operators with examples.
24. Describe the structure of a C program by explaining the process of writing, compiling,
and executing a C program (with a diagram showing source code → object code →
executable code).
25. Differentiate between syntax errors and logical errors with suitable examples.
26. Explain the commenting style used in "Programming in C".
27. Use an example of calculating the sum of two numbers.
28. Write a C program for following problems:
a. Swap two numbers using third variable.
b. Swap two numbers without using third variable
29. A vehicle registration system encodes the numeric part of the plate by adding 1 to each
digit without carry. Example: 2457 → 3568. Write a program for the encoding.
30. Draw a flowchart for a C program that checks whether the entered number is a prime
number or not.
31. Draw a flowchart to find the maximum of three given numbers.
32. Explain the conditional operator used in C Programming.
33. Write a C program using an if-else statement to find the greatest of three numbers.
34. Write a C program using a for loop to display the multiplication table of 5.
35. Explain the different types of operators in C (arithmetic, relational, logical, bitwise,
assignment with suitable examples. Also discuss operator precedence and
associativity.
36. Explain conditional branching and looping. also write a C program to explain the same
with example.
37. Write a program that takes two operands and one operator from the user, perform the
operation, and prints the result by using Switch statement.
38. Write a program to check whether a given number is Armstrong or not.
39. Form a Number from Digits
Problem Statement: You are given n digits, each entered separately by the user. Your
task is to combine these digits in the same order to form a single number.
Input Format:
The first line contains an integer n (number of digits).
The second line contains n space-separated digits.

Output Format:
Print the number formed by the digits.
Constraints: 1 <= n <= 10 and each digit d satisfies 0 <= d <= 9. Leading
zeros are allowed.
Sample Input 1
4
5678
Sample Output 1
5678
Sample Input 2
6
012345
Sample Output 2
12345
40. Write a C program to generate and display the following series up to n terms:
1,4,9,16,25,…...
41. Write a C program to calculate the factorial of a number entered by the user.
42. Write a program to find sum of the following series. 1+2+.....+100
43. Write C Code to print following pattern using a loop:
*
**
***
****
*****

You might also like