0% found this document useful (0 votes)
3 views7 pages

Programming C-Importent Questions

The document consists of a series of questions and tasks related to computer programming, particularly in C language, covering topics such as memory types, data types, control structures, algorithms, and flowcharts. It includes practical programming exercises, binary operations, and comparisons between programming concepts. Additionally, it emphasizes the importance of comments, data types, and constants in coding practices.

Uploaded by

ayan09072007
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)
3 views7 pages

Programming C-Importent Questions

The document consists of a series of questions and tasks related to computer programming, particularly in C language, covering topics such as memory types, data types, control structures, algorithms, and flowcharts. It includes practical programming exercises, binary operations, and comparisons between programming concepts. Additionally, it emphasizes the importance of comments, data types, and constants in coding practices.

Uploaded by

ayan09072007
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/ 7

Part -A (2 marks)

1. What is the difference between primary and secondary memory.


2. Explain the full form of EPROM.
3. Write down the name of one line conditional operator.
4. What is a datatype? Explain various datatypes used in C.
5. Distinguish between variable and constant in C
6. Define a Variable. Differentiate between Variable Definition and Declaration with a
simple example.
7. What is sequential access? Give one example.
8. Explain the full form of RAM.
9. What do you mean by algorithm?
10. Explain the difference between switch-case and if-else
11. What do you understand by tokens? Name the different type of tokens
12. What is a flowchart? Mention any two advantages of using it and the symbols used
for drawing a flowchart.
13. Differentiate between RAM and ROM.
14. Write a program to add two numbers.
15. Describe Assembly Language.
16. Describe the term keywords. Give an example.
17. Explain the difference between sequential and random access, direct access methods
with a suitable example.
18. Perform Binary Addition and Subtraction:
(i) (10110)2 + (11011)2
(ii) (10110)2 − (1101)2
19. Describe the base and range of binary, octal and hexadecimal number system.
20. Describe arithmetical or mathematical operators.
21. What does ASCII stand for?
22. Describe input & output statements.
23. Define what a high-level programming language is.
24. Define Number system.
25. List four C tokens.
26. Describe the structure of a basic C program.
27. Define Stored Program in computer Architecture.
28. Perform the binary addition 10101 and 10100.
Part-B ( 5 Marks)
1. Represent an algorithm for finding the largest of two numbers, and also draw a
flowchart.
2. Describe the use of flow charts. Draw a flow chart of finding a even and odd number
program.
3. Analyse the role of comments in improving code readability and maintainability.
4. Explain the structure of a C program with an example.
5. Convert the binary number 10101 into decimal, octal, and hexadecimal
6. Convert the decimal number 345 into binary, octal, and hexadecimal. Show each
conversion step clearly.
7. Analyse the role of operators and expressions in simplifying program logic
8. Analyze the use of relational operators in programming. Why they are important in
decision making process?
9. Perform the binary addition and subtraction of the following numbers:
a) 1101 + 1011
b) 1110 + 1111
c) 10110 – 1101
d) 1001- 111
10. Write a program to check entered alphabet is vowel or consonant (consider both small
and capital letters).
11. Write a C program snippet using switch to display the day of the week based on user
input.
12. Write a program to swap two values using a third variable
13. Differentiate between while and do-while loops with an example
14. Apply the concept of ternary operator to find out the eligibility of vote threw C
program
15. Analyze the differences between high-level language, assembly language, and low-
level (machine) language with suitable examples.
16. Analyze the following program and identify errors (if any). Rewrite the corrected
code and explain the mistakes.
a. #include <stdio.h>
b. int main() {
c. int a = 10, b = 20;
d. if (a = b)
e. printf("Equal");
f. else
g. printf("Not Equal");
h. return 0;
i. }
17. Analyze how random, direct and sequential access method differ in terms of data
retrieval using example?
18. Explain the concept of Stored Program Architecture in detail with diagram.
19. Analyze the use of format specifiers in C. Why it’s important for making a input
output operations in C?
20. Evaluate the output of the following code.
21. #include<stdio.h>

void main(){
int x = 5;
int y = x++;
print(“%d%d”,x,y);
}
22. Apply the concept of if-else to find out the given number is even or odd. Explain with
a suitable program.
23. Describe the use of constants in programs. How we can work on constants in C
explain the ways of declaring constants.
24. Convert the following
a. (255)10 = (?)2
b. (100101)2 = (?)10
c. (526)8 = (?)10
d. (11100101)2 = (?)8
e. (A2DE)16 = (?)10
f. (352)10 = (?)2
g. (453)16 = (?)10
h. (110011)2 = (?)10
i. (64)10 = (?)2
25. Construct a C Program to check whether the number is positive or negative.
26. Differentiate between if and if-else statements with suitable examples.
27. Explain what C tokens are and categorize them with examples from C programming.
28. Differentiate between compiler and interpreter.
29. What will be the output of the following code?

#include<stdio.h>
int main() {
int i = 4;
switch(i) {
default:
printf("This is default\n");
case 1:
printf("This is case 1\n");
break;
case 2:
printf("This is case 2\n");
break;
case 3:
printf("This is case 3\n");
}
return 0;
}

30. Write a C program to swap (interchange) two numbers without using third variable.
Draw the flowchart for it.
31. Evaluate the output of the program:
int main() {
int a = 7;
int b = ++a;
printf("%d", a);
printf("%d", b);
return 0;
}
32. Rewrite the following code.

#include<stdio.h>
int main(){
printf(Hello World!)
return 0
33. Explain the different data access methods used in storage devices.
Part-C (10 Marks)
1. Perform following operations
a) (1000100011)2=()16
b) 1011100100+111110001 binary addition.
c) 1111011-1011011 binary substation.
d) (198)8= ()2
e) (1EF)16=()8
2. Analyze how the stored program architecture improved computer functionality
compared to earlier computing machines.
3. Illustrate the different types of conditional statements with suitable examples.
4. Write a program to check whether the entered number is even or odd. If the number is
even than add 10 to it.
5. Write a C program using if-else to find the largest of three numbers using nested if
statement.
6. Apply the concept of arithmetic operators and make a program which solves the
equation of x+y*z/10.
7. Write a program using switch-case to create a simple calculator (addition, subtraction,
multiplication, division). Analyse the advantages of using a switch over multiple if-
else.
8. Develop a C program that reads an integer and checks whether it is even or odd using
conditional statements and an if-else statement.
9. Write an algorithm, pseudocode and flowchart to check whether the candidate is
eligible for vote or not.
10. Explain the different types of operators used in C with suitable example.
11. Illustrate the use of switch case statement using an example.
12. What do you understand by a constant in C? How does it differ from a variable?
Explain with an example.
13. Illustrate the differences between pseudo code and algorithm and draw a flowchart to
find the roots of quadratic equation ax2+bx+c=0.
14. Develop an algorithm and flow chart for finding whether the number is even or odd.
15. Draw flow chart for the following code:

#include<stdio.h>
void main(){
int x ,y;
printf(“Enter the value of a & b);
scanf(“%d%d”,&a,&b);
z= x+y;
print(“Sum of %d + %d = %d”,x,y,z);
}
16. Write a program to calculate the area and perimeter of a rectangle given length and
width from user input with suitable flow diagram.
17. Illustrate the concept of Type Conversion in C with its types and an example.
18. Analyze the use of assembler, compiler and interpreter. Explain how they are different
to each other in working.
19. Organize a small program that takes marks from the user and categorizes the grade as
A, B, or C using nested if-else statement. Draw flowchart also for this.
20. Implement the following code using if-else without compromising on the underlying
logic.

#include<stdio.h>
int main() {
char op;
int a, b, res;

// Read the operator


printf("Enter an operator (+, -, *, /): ");
scanf("%c", &op);

// Read the two numbers


printf("Enter two numbers: ");
scanf("%d %d", &a, &b);

switch (op) {
case '+':
printf("%d", a + b);
break;
case '-':
printf("%d", a - b);
break;
case '*':
printf("%d", a * b);
break;
case '/':
printf("%d", a / b);
break;
default:
printf("Error! Incorrect Operator Value\n");
}
return 0;
}

21. Illustrate the output of the following program.

#include <stdio.h>
int main ()
{
int num;
printf (" Enter a positive number: ");
scanf (" %d", &num);
num = (num >> 1);
printf (" \n After shifting the binary bits to the right side. ");
printf (" \n The new value of the variable num = %d", num);
return 0;
}
22. Evaluate the following program for errors and suggest improvements:

int main() {
int x
printf("Enter a number: );
Scanf("%d", x);
if (x > 0);
printf("Positive");
return 0;
}
23. Assess the importance of data types and constants in preventing errors in C programs.
Name the types of constants.

You might also like