Quize_round1
Quize_round1
a) printf("Hello World");
b) cout << "Hello World";
c) Console.WriteLine("Hello World");
d) System.out.printline("Hello World");
a) # This is a comment
b) $ This is a comment
c) /* This is a comment
d) // This is a comment
a) False
b) True
a) False
b) True
a) num = 5 int;
b) int num = 5;
c) val num = 5;
d) num = 5;
6. How can you create a variable with the floating number 2.8?
a) The * sign
b) The ADD keyword
c) The + sign
d) The & sign
a) write()
b) printf()
c) printword()
d) output()
a) %c
b) %d
c) %f
d) %s
a) <>
b) =
c) ==
d) ><
11. Which operator can be used to find the memory size (in bytes) of a data type or
variable?
a) const
b) final
c) constant
d) readonly
13. What do we call the following? int myNumbers[] = {25, 50, 75, 100};
a) An array
b) A class
c) None of the above
d) A pointer
a) 0
b) 1
a) if x > y then
b) if x > y
c) if (x > y)
d) if x > y()
a) get
b) break
c) void
d) return
a) for (x in y)
b) for (i = 0; i < 5; i++)
c) for (i = 0; while < 5; i++)
d) for (i = 0; switch < 5; i++)
19. Which statement can be used to select one of many code blocks to be executed?
a) switch
b) default
c) when
d) break
a) stop
b) break
c) exit
d) void
a) class
b) None of the above
c) class()
d) class = myClass
22. What is ptr in the following code known as? int* ptr = &myAge;
a) A class
b) A pointer
c) A parameter
d) An array
23. In C, it is possible to inherit class properties and functions from one class to
another.
a) True
b) False
a) struct
b) structs
c) str
d) structure
answer b
answer c
answer b
#include <stdio.h>
int main()
printf("Condition is true.");
else
printf("Condition is false.");
return 0;
a) Condition is true
b) Condition is false
c) Compilation Error
d) No output possible
answer a
#include <stdio.h>
int main()
switch(printf("Techmiti"))
default:
printf("FIRE");
case 1: printf("Intresting");
break;
case 2: printf("Fun");
break;
break;
return 0;
}
a) Techmiti FIRE Intresting
b) Techmiti Intresting
c) Techmiti Fun
d) Techmiti FIRE
a) e> Techmiti Exciting
answer a.
#include <stdio.h>
int main()
int x;
x = 4 > 8 ?5 != 1 < 5 == 0 ? 1: 2: 3;
printf("%d", x);
return 0;
a) 1
b) 2
c) 3
d) Error
``answer c
27. An integer array (An integer takes two bytes of memory) of size 15 is declared in a C
program. The memory location of the first byte of the array is 2000. What will be the
location of the 13th element of the array?
a) 2013
b) 2024
c) 2026
d) 2030
answer b
28. What is the output of the program?
#include<stdio.h>
str1 = str2;
str2 = temp;
int main()
swap(str1, str2);
return 0;
answer a.
int y, z;
**ppz += 1;
z = **ppz;
*py += 2;
y = *py;
x += 3;
return x + y + z;
int main()
c = 4;
b = &c;
a = &b;
return 0;
a) 18
b) 19
c) 21
d) 22
Answer b.