0% found this document useful (0 votes)
3 views

Test Computer Science

The document is a test for a Computer Science chapter, consisting of multiple-choice questions, short answer questions, and long questions related to C programming. It covers topics such as IDE features, variable declaration, data types, and basic program structure in C. The test includes a total of 35 marks and requires students to solve various programming-related problems.

Uploaded by

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

Test Computer Science

The document is a test for a Computer Science chapter, consisting of multiple-choice questions, short answer questions, and long questions related to C programming. It covers topics such as IDE features, variable declaration, data types, and basic program structure in C. The test includes a total of 35 marks and requires students to solve various programming-related problems.

Uploaded by

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

TEST : COMPUTER

SCIENCE
CHAPTER: 01
Total marks: 35
Obtained marks:
1.Solve all the Multiple-choice Questions.
1.. Which of the following is a common feature of an IDE?
i) Web hosting services ii) Text formatting tools
iii) Code editor, debugger, and compiler iv) Video editing tools
2.Which of the following is an example of a text editor?
i) Google Chrome ii) Microsoft Wor
iii) Notepad++ iv) Microsoft Excel
3. What does the compiler do if it finds an error in the code?
A) Ignores the error B) Fixes the error
automatically
C) Stops and shows an error message D) Completes the program
without any warning
4. What is the correct syntax to declare a variable in C?
A) var x = 5; B) int x = 5;
C) let x = 5; D) declare x = 5;
5. Which of the following is a reserved word in C?
A) printf B) scanf
C) if D) myVariable
6. What happens if a header file is included multiple times in a
program without protection?
A) The program will run normally B) It will cause a multiple definition
error
C) It will optimize the code D) It will ignore repeated inclusions
7. Which of the following pairs of identifiers would be treated as
different in C?
A) myVar and myvar B) function1 and Function1
C) HELLO and hello D)ALL OF THE ABOVE
8. Which of the following is the correct order of a basic C
program structure?
A) Variable declaration → Function → Header files
B) Header files → Main function → Statements
C) Statements → Header files → Main function
D) Function → Header files → Return statement
9. Which of the following is the correct syntax for a single-
line comment in C?
A) <!-- Comment --> B) /* Comment */
C) # Comment D) // Comment
10. Can comments be nested in C (i.e., /* /* nested */ */)?
A) Yes, always B) No, it causes a compilation error
C) Only in certain compilers D) Only with special syntax

11. What is the correct syntax for declaring an integer variable in C?


A) integer x; B) int x;
C) num x; D) declare int x;
12. Which of the following data types has the largest size in C?
A) int B) float
C) double D) long
13. The size of double in C is typically:
A) 4 bytes B) 8 bytes
C) 16 bytes D) 2 bytes
14. Which of the following is a valid variable name in C?
A) int 2number; B) int _number;
C) int number@; D) int number%2;
15. Which character is allowed in variable names in C?
A) * B) &
C) _ D) #

2.Answer Short question.


1. Define IDE with any 3 examples?
2. Define the structure of C language?
3. Explain Multiple line comments?
4.
int main()
{
int num1, num2, sum, product printf
("Enter two numbers: ")
scanf("%d %d", &num1, &num2)
sum = num1 + num2
product = num1 * num2
printf("Sum = %d\n" sum)
printf("Product = %d\n" product)
return 0
5.Create a C language Program In which User takes a number and
Checks if the number is even or odd?
2. Long Question.
Create a Program to find the largest of three
numbers.a,b,c.

You might also like