Past Papers Notes Generator Questions

Variables and data types Questions
Computer Science 101 - Programming Fundamentals Past Papers

Practice 68 past-paper questions for Variables and data types in Computer Science 101 - Programming Fundamentals. Get solutions and exam preparation resources.

Click on a question to view the full answer

1. What is the difference between a variable and a constant in programming? Provide examples.
View
2. What is the difference between `int` and `float` data types in programming? Provide examples.
View
3. What is the difference between `static` and `dynamic` typing in programming?
View
4. What is a variable? Write down significant rules for giving name to an identifier.
View
5. Discuss the different collection data types available in python programming with suitable examples of each. How could th…
View
6. What is the maximum length of a Python identifier? a. 8 b. 16 c. 32 d. No fixed length is specified
View
7. Which of the following is the CORRECT extension of the Python file? a. .pth b. .py c. .python d. .pl
View
8. Which character is used in Python to make a single line comment? a. / b. // c. # d. !
View
9. What is a variable in Python? a. A container to store data b. A loop to iterate through data c. A conditional statement…
View
10. What is the correct way to create an integer variable named "x" with value 1 in Python language? a. int x = 1 b. x = 1…
View
11. (958)10 is equivalent to ( )16
View
12. The word length of a computer is measured in
View
13. What is Number System? Explain different types of Number System. How can you do conversion from one number system to ano…
View
14. 3. What does the sizeof() operator do in C programming? a. It gives the size of operator. b. It gives the size of varia…
View
15. 4. The number 45.56 needs to be stored in a variable of data type? a. int b. double c. long int d. float
View
16. Write a program to check whether a number is palindrome or not. Palindrome number remains the same when its digits are r…
View
17. Write about storage class specifiers and their different types in C programming.
View
18. Write a program to store information about employees which can hold name, employee ID(int), basic salary (int), allowanc…
View
19. Which of the following is a desirable characteristic of a good C program?
View
20. Which of the following is not a valid C variable name?
View
21. Which keyword is used to prevent any changes in the variable within a C program?
View
22. What will be the output of the following program? #include<stdio.h> void main(){ int a=5, b=2; printf(*%d”,a/b); }
View
23. An Ampersand (&) in scanf() before the name of a variable denotes ________.
View
24. What type of programming language is C?
View
25. Can reserved words and keywords be the same in C?
View
26. What are certain non-printing characters known as in C?
View
27. How are operators grouped in C?
View
28. What is the result of the given expression?
View
29. Which is not a conversion character?
View
30. Which of the following is TRUE about C identifiers? a) It can be started with underscore (_) b) It cannot be same as a…
View
31. Which of the following is NOT an operator in C programming? a) % b) =< c) &&
View
32. What does the following statement return? `5&&6` a) 0 b) 1 c) 6
View
33. What is the output of the following program? ```c #include <stdio.h> void main() { int b = 3 + 2 % 4 % 3; printf…
View
34. What are relational operators? Provide a C snippet that demonstrates use of ! = (not-equal-to) relational operator. How…
View
35. What is an array? How does passing a variable to function differ with passing an array to function?
View
36. What are static storage classes? Write a complete C program that shows the use of static variable.
View
37. Which one is the correct order of operators according to higher precedence?
View
38. Which one of the followings operators has right-to-left associativity?
View
39. Write a program to represent an age of a person in years, months and days. Implement operator overloading which calculat…
View
40. 2. Which of the following will be printed? x= 9.5 y= 2 print x//y
View
41. 4. Which character is used for commenting in Python?
View
42. 6. The symbols <<,>>, and * are all operators. [ ] Bitwise [ ] Arithmetic [ ] Comparison [ ] Assignment
View
43. 7. What will be the output of str[0:3] if str= 'Kathmandu'?
View
44. 8. Which of the following is a list? [10L2,3] [1{(7,8,9} [10(7.8,9) [1<4,5,6>
View
45. 10. What will be the output of the following code snippet? a=1[1, 2, 3,4, 5] sum = @ for ele in a: sum += ele print(sum)
View
46. 11. A is a variable that is created inside a function. [ ] global variable [ ] local variable [ ] hidden variable [ ] no…
View
47. 12. Which of the following data types does not belong to Python? [ ] String [ ] Tuple [ ] Dictionary [ ] Stfucture
View
48. 15. Which of the following operators is the correct option for power(xy)? [1x"y x**y [1x*"y [1x~*y
View
49. 16. What will be the output of the following code? myTuple = (1, 2, 3); print(myTuple(1])
View
50. 20. What does Matplotlib provide in Python? [ ] Data manipulation [ ] Data visualization [ ] Number Calculation [ ] Text…
View
51. Explain the purpose of the range() function in Python and provide an example of how it's used within a for loop.
View
52. Describe the difference between a list and a tuple in Python. When would you choose one over the other?
View
53. What is a comment in Python, and why is it considered good programming practice to include comments? Discuss with an exa…
View
54. Explain the concept of "scope" in Python variables. Differentiate between local and global scope with simple examples.
View
55. 2. Discuss the concept of operator precedence in Python. Provide an example where operator precedence affects the result…
View
56. What is variable? Write any four rules for writing identifier.
View
57. Which of the following is valid in Python language?
View
58. What is the output of the given code? a="hello" b='Pharmacy' c=b+a print(c)
View
59. What is the output of the given code? a="language" print (a[-7:-3])
View
60. The string build-in method islower()
View
61. What is the output of the following code? result=23%6 print(result)
View
62. What is the output of the following code? hi=('a','b',1,2.5) print (hi)
View
63. What will be the output of the following Python code snippet? a={"Ram":21, 'Hari':12} print(a)
View
64. What do you mean by python tuples?
View
65. What will be the output of the following Python code snippet? num=set([1,2,3,1,2,3]) print (len(num))
View
66. What are used to store the values in keys and pairs.
View
67. Discuss the characteristics of signed magnitude, signed 1’s complement and signed 2’s complement numbers.
View
68. What does '3NF' (Third Normal Form) focus on in database design?
View
Sponsor Space