Font size
WorksheetsC++ Is Fun
Total questions: 10
Worksheet time: 5mins
Which among the below is correct?
#include "stdio.h"
#include <stdio.h>
#include <stdio>
#include "stdio"
What is wrong (if any) in the code?
CBase : Function()
CDerived : Function()
CBase : Function()
CDerived : Function()
Compilation Error
What will be the output to the program?
x is greater than or equal to y
x is greater than y
x is smaller than y
Compiler Error or Warning
What is the below code example of?
int myFunction(int x);
float myFunction(float x);
double myFunction(double x, double y);
Operator overloading
Polymorphism
Function Overloading
Functional Parameters
Select the correct format for selecting elements in the array of 3 integers.
arr[0]
arr[1]
arr[2]
*(arr + 0);
*(arr + 1);
*(arr + 2);
(arr + 0);
(arr + 1);
(arr + 2);
&(arr + 0);
&(arr + 1);
&(arr + 2);
What will happen in the below situation?
int arr[5] = {1,2,3};
int nget = arr[5];
Compiler Warning
Compiler Error
Crash
Garbage Value
Predict the output to the below -
int* pNum = new int;
*pNum = 10;
free(pNum);
Below is an example of
int *pNum = new int;
*pNum = new int;
(a)
What is the wrong the given code?
(a)
What is wrong with the code?
static is not declared as const
GetValue() will return the value
"i" is uninitialized in the GetValue()
return values should be included in "(", ")"
