0% found this document useful (0 votes)
83 views5 pages

Programming Basics Quiz Questions

The document is a question paper consisting of 50 multiple-choice questions covering various programming concepts, languages, and technologies. Topics include C programming, Python, HTML, CSS, Java, JavaScript, SQL, and general programming principles. Each question presents options for answers, testing knowledge on syntax, functions, and definitions within these languages.

Uploaded by

A
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)
83 views5 pages

Programming Basics Quiz Questions

The document is a question paper consisting of 50 multiple-choice questions covering various programming concepts, languages, and technologies. Topics include C programming, Python, HTML, CSS, Java, JavaScript, SQL, and general programming principles. Each question presents options for answers, testing knowledge on syntax, functions, and definitions within these languages.

Uploaded by

A
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

QUESTION PAPER 1

1.​ What is the output of the program?

#include <stdio.h>

intmain() { int x =20; x %=3; printf("%d",x);

return0; }

a. 2 ​ ​ b. 2.5 ​ ​ c. Error ​ d. Warning

2.​ Which of the following is a valid variable name in most programming languages?

a) 1variable ​ ​ b) variable_1 ​ ​ c) variable-1 ​ ​ d) variable 1

3.​ What does HTML stand for?

a) Hyperlinks and Text Markup Language

b) Hyper Text Markup Language

c) Home Tool Markup Language

d) Hyper Tool Markup Language

4.​ CSS is used for:

a) Structuring web pages

b) Styling web pages

c) Scripting web pages

d) None of the above

5.​ Which HTML tag is used to create a hyperlink?

a) <link>​ b) <a>​​ c) <href>​ d) <hyper>

6.​ Which of the following is a client-side scripting language?

a) PHP ​ b) Python ​ c) JavaScript ​ ​ d) Ruby

7.​ Which company developed Java?

a) Google ​ ​ b) Microsoft ​ ​ c) Sun Microsystems ​​ d) Apple


8.​ Which of the following is not a looping statement in C?

a) for ​ ​ b) while ​ c) repeat ​ d) do-while

9.​ Which symbol is used for comments in C?

a) // ​ ​ b) /* */​ ​ c) # ​ ​ d) ;;

10.​ A compiler is used to:

a) Convert high-level language to machine language

b) Execute code line by line

c) Connect to databases

d) Design graphics

11.​ What is the output of 3 + 2 * 2 in C?

a) 10 ​ ​ b) 7 ​ ​ c) 9 ​ ​ d) 12

12.​ What is the purpose of #include in C?

a) To start the program

b) To include header files

c) To define functions

d) To create variables

13.​ Which of the following is a valid float declaration?

a) float x = 2.5;

b) float x = "2.5";

c) float x = '2.5';

d) float x = 2,5;

14.​ Which operator is used for logical AND in C?

a) & ​ ​ b) && ​ ​ c) | ​ ​ d) ||

15.​ Which function is used to read input in C?


a) scanf() ​ b) read() ​ c) gets() ​ d) input()

16.​ In C, what does the "break" statement do?

a) Skips one iteration

b) Exits the loop

c) Continues to next iteration

d) Ends the program

17.​ Which of these is used to comment a single line in Python? a) // b) c) # d) /* */​

18.​ What is the correct file extension for Python files? a) .pyth b) .pt c) .py d) .python​

19.​ Which of the following is a valid Python data type? a) number b) decimal c) int d) real​

20.​ In Python, which keyword is used to define a function? a) func b) define c) def d) function​

21.​ In Python, which function is used to display output? a) printf() b) display() c) print() d)
show()​

22.​ What is indentation used for in Python? a) Commenting b) Looping c) Defining blocks of
code d) Highlighting​

23.​ Which of these is a correct way to start a for loop in Python? a) for x to y: b) for x = 1 to
10: c) for x in range(10): d) loop x in range(10):​

24.​ In Python, what does "len()" function do? a) Calculates length of an integer b) Calculates
memory usage c) Returns number of items in a list or string d) None of the above​

25.​ Which of the following is not a data structure in Python? a) List b) Tuple c) ArrayList d)
Dictionary​

26.​ Which of these is used to store multiple items in a single variable? a) int b) float c) list d)
char​

27.​ In C, arrays start from index: a) 1 b) 0 c) -1 d) 2​

28.​ Which of the following denotes a string in C? a) "Hello" b) 'Hello' c) Hello d) (Hello)​

29.​ A pointer in C is: a) A variable that stores address of another variable b) A function c) An
array d) A compiler​
30.​ Which of these is a relational operator? a) + b) && c) == d) =​

31.​ What is the output of print("Hello" + "World") in Python? a) Hello+World b) Hello World c)
HelloWorld d) Error​

32.​ Which of the following is not a loop structure? a) while b) do-while c) repeat-until d)
switch​

33.​ What is the function of the return statement in C? a) Terminates a function and optionally
returns a value b) Continues the loop c) Ends the program d) None​

34.​ The "elif" keyword in Python is used for: a) Ending a loop b) Starting a new block c)
Checking multiple conditions d) None of the above​

35.​ What is a function? a) A collection of statements that perform a task b) A type of loop c)
A file d) A module​

36.​ Which of these is a valid loop syntax in Python? a) while (x < 5) b) while x < 5: c) while x
< 5 {} d) while(x<5):​

37.​ What will be the output of print(type("5")) in Python? a) int b) str c) float d) type​

38.​ What does IDE stand for? a) Internal Development Environment b) Integrated Design
Environment c) Integrated Development Environment d) Interactive Development
Environment​

39.​ What is the extension of Java source code files? a) .jav b) .java c) .js d) .jv​

40.​ JavaScript is mainly used for: a) Backend development b) Frontend development c)


Database management d) Mobile app development​

41.​ Which of the following is not a programming paradigm? a) Object-oriented b) Functional


c) Procedural d) Typographic​

42.​ Which programming language is mainly used for AI? a) HTML b) Python c) JavaScript d)
SQL​

43.​ The keyword "class" is used to define: a) A function b) A loop c) A class d) A variable​

44.​ Which of the following is a database management system? a) MySQL b) Java c) XML d)
HTML​
45.​ Which SQL statement is used to retrieve data? a) GET b) SELECT c) FETCH d)
RETRIEVE​

46.​ Which language is used to style web pages? a) Java b) Python c) CSS d) SQL​

47.​ An error in a program that prevents it from running is called: a) Syntax error b) Logic
error c) Runtime error d) Compilation​

48.​ What is Git used for? a) Programming b) Version control c) Web design d) Data science​

49.​ A collection of related web pages is called a: a) Website b) Web browser c) Web server
d) Homepage​

50.​ What is a boolean value? a) 0 or 1 b) True or False c) Yes or No d) All of the above​

You might also like