Home Most Important Questions of C-Language | 20 Set of Questions ||Programming Language | Edu Verse By Pratik Pratik Patel -July 09, 2024 0 Solve This Quiz Simple Quiz Simple Quiz Question 1: What is a correct syntax to output "Hello World" in C? A) cout< ("Hello World"); B) printf("Hello World"); C) Console.WriteLine("Hello World"); D) scanf("Hello World"); Question 2: How do you insert COMMENTS in C code? A) --This is a comment B) *This is a comment C) //This is a comment D) #This is a comment Question 3: In C, code statements must end with a semicolon (;)? A) True B) False Question 4: How can you create a variable with the numeric value 5? A)int num = 5; B)val num = 5; C)num = 5 int; D)num = 5; Question 5: How can you create a variable with the floating number 2.8? A)float num = 2.8; B)val num = 5; C)num = 2.8 float; D)num = 2.8; Question 6: Which operator is used to add together two values? A)The + sign B)The Add keyword C)The * sign D)The & sign Question 7: Which function is often used to output values and print text? A)printf() B)printword() C)write() D)output() Question 8: Which format specifier is often used to print integers? A)%c B)%s C)%d D)%f Question 9: Which operator can be used to compare two values? A)== B)<> C)= D)>< Question 10: How do you call a function in C? A)myFunction() B)myFunction; C)myFunction[] D)(myFunction); Question 11: How do you start writing an if statement in C? A)if x > y() B)if(x > y) C)if x > y D)if x > y then Question 12: Which keyword is used to return a value inside a function? A)void B)break C)return D)get Question 13: How do you start writing a for loop in C? A)for(int i = 0; while < 5; i++) B)for (x in y) C)for(int i = 0; switch < 5; i++) D)for(int i=0; i<5; i++) Question 14: Which statement can be used to select one of many code blocks to be executed? A)switch B)default C)when D)break Question 15: Which keyword is used to create a class in C? A)class() B)class = myClass C)class D)None of the above Question 16:Which keyword is used to create a structure? A)structs B)struct C)structure D)str Question 17:How do you start writing a while loop in C? A)while (x < y) B)while x < y then C)while x < y D)if x > y while Question 18:Which keyword is used to return a value inside a function? A)return B)void C)break D)get Question 19:What do we call the following? int myNumbers[] = {25, 50, 75, 100}; A)A pointer B)An array C)None of the above D)A class Question 20:Which keyword can be used to make a variable unchangeable/read-only? A)constant B)final C)readonly D)const Submit Facebook Twitter