[go: up one dir, main page]

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

suggestion

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 7

MODULE-1 SUGGESTION

1marks
1. Left shift operation is equivalent to?
a) Division by 2 b) Multiplying by 2 c) Adding 2
d) Subtractin

2. Which is a ternary operator?


a) # b) : c) ? d) None of these

3. ASCII value of zero(0) is:


a) 0 b) 1 c) 48 d) 36

4. Who invented C language?


a) Newton b) Charles Babbage c) Galileo d)
Dennis Ritchie

5. The full form of ASCII


a) American Standard Code for Information Interchange
b) American Standard Code for International Interchange
c) American Standard Code for Informative Interchange
d) None of these

6. What is the associativity of the unary operator ?


a) Right to Left b) Left to Right c) Both d) None of
these

7. Method which uses a list of well defined instructions to complete a task


starting from a given initial state to end state is called as
a) Program b) Flow chart c) Algorithm d) None of
these
void main()
{ int 2a=10;
a) printf(“%d”,2a);
}
a)10 b) 2a c) 20 d) Compilation Error
8. void main()
{ int a=0;
a=5<2?4:3;
printf(“%d”,a);
}
a) 4 b) 3 c) 5 d) 2
9. Find output of following program?
main()
{
int x,y,z;
x=y=z=1;
z=++x||++y&&++z;
printf(“x=%d y=%d z=%d”,x,y,z);
} a) x=2 y=1 z=1 b) x=2 y=2 z=2 c) x=2 y=2 z=1 d) x=2 y=1 z=2
10.Find the output?
void main()
{ int x=10,y=-20;
x=!x;
y=!y;
printf(“x=%d y=%d”,x,y);
}
a) x=0 y=0 b) x=10 y=-20 c) x=10 y=0 d) x=0 y=-20

11.What will be the output of the following program


void main()
{ int x=4,i;
i=x++ + ++x;
printf(“x= %d z=%d”,x,i); }

a) x=6 i=10 b) x=5 i=11 c) x=6 i=11 d) x=5 i=10


12.Assuming int is of 4bytes, what is the size of int arr[15];?
a) 15 b) 19 c) 11 d) 60

13.Find the value of p and q?


void main()
{int x=10,y=5,p,q;
p=x>9;
q=x>3 && y!=3;
printf(“p=%d q=%d”,p,q);
}
a) p=0 q=0 b) p=0 q=1 c) p=1 q=0 d) p=1 q=1
14.What does the term "computer" derive from?
A) Computare
B) Compute
C) Computation
D) Computerize
Answer: A) Computare
15.Who invented the Difference Engine?
A) John Mauchly
B) Charles Babbage
C) Steve Jobs
D) Herman Hollerith
Answer: B) Charles Babbage
16.What is the primary purpose of an input device in a computer system?

A) To display output

B) To provide data and control signals to the computer


C) To store data

D) To process data

Answer: B) To provide data and control signals to the computer


17.An Algorithm represented in the form of programming languages is
_________
a.Flowchart
b.Pseudo code
c.Program
d.None
18.Which storage class in C is used for variables that retain their value across
multiple function calls within the same program?
A) Automatic
B) Register
C) Static
D) External
Answer: C) Static
19.Which of the following is the base of the hexadecimal number system?

A) 2
B) 8
C) 10
D) 16

Answer: D) 16
20.What is the associativity of the assignment operator = in C?
A) Left-to-right
B) Right-to-left
C) None (no associativity)
D) Depends on the expression
Answer: B) Right-to-left
21.Which of the following was the first large-scale computer to run at electronic
speed?
 A) UNIVAC
 B) ENIAC
 C) EDVAC
 D) EDSAC
Answer: B) ENIAC
22.What is the binary equivalent of the decimal number 13?
A) 1101
B) 1011
C) 1110
D) 1001
Answer: A) 1101
23.In C, which of the following operators has the highest precedence?
A) + (addition)
B) && (logical AND)
C) ++ (increment)
D) == (equality)
Answer: C) ++ (increment)
24.What will be the output of the following C code snippet?
#include <stdio.h>
int main() {
int a = 5, b = 10, c = 15;
int result = a < b && b < c || c++ > b;
printf("result = %d, c = %d\n", result, c);
return 0;
}
A) result = 1, c = 16
B) result = 1, c = 15
C) result = 0, c = 16
D) result = 0, c = 15
Answer: B) result = 1, c = 15
25.Question: What is the primary function of the CPU in a computer system?
A) To store data permanently
B) To execute instructions and process data
C) To manage input and output operations
D) To provide power to the computer
Answer: B) To execute instructions and process data
26.The process of drawing a flowchart for an algorithm is called __________
a. Performance b) Evaluation c) Algorithmic Representation d) Flowcharting
27.In C programming, which keyword is used to assign meaningful names to
existing variable types, making the code more readable?
A) typedef
B) enum
C) bool
D) void
Answer: A) typedef
5marks
1. Explain precedence and associativity of operators with suitable examples.
2. What is a compiler? List names of any 2 compilers.
What are the benefits of designing a flowchart for solving a problem? [3+2]
3. Difference between compiler and interpreter .
4. Define Algorithm. Write an algorithm to find the area and perimeter of a circle
5. Draw the flowchart and write a C program to compute simple interest.
6. Discuss about Programming errors in C.
7. Define a computer and explain its basic functions.
8. Summarize the evolution of computers from the Difference Engine to the
Apple I.
9. A.Convert (A2DE.25)16 TO DECIMAL.
B.Convert (345.75)8 to Hexadecimal.
10.Define the different types of operators in C and provide examples for each.
11.Explain how each type of operator is used in programming with sample code
snippets.
12.Describe the difference between if-else and switch statements with examples.
13.Explain the different types of input devices. How do they facilitate user
interaction with a computer? Discuss at least three types of input devices and
their functions.
14.Explain different flowchart symbols with name and example.
15.Write the basic structure of C and explain.
10marks
1. A.Draw a flowchart for finding greatest among three numbers. Follow the
proper order according to the given algorithm, while creating the flowchart.
Let x, y and z be the numbers.
Now, we can follow the algorithm below to determine the greatest number
among the three:
Read the three numbers.
If x > y
If x > z,
then x is the greatest number.
Else, z is the greatest number
Else, If y > z,
then y is the greatest number.
Else, z is the greatest number.
B.Write the advantages and disadvantages of flowchart.
2. A.Briefly explain tokens with example.
B. Explain different types of data types.

3. Using a for loop, write a program that calculates the factorial of a given
number. Include comments explaining each part of the code.
4. Show briefly operators precedence and associativity with example .

You might also like