If 1 = 1, 2 = 4, 3 = 10 and 4 = 22, then 5 = ?
Is the following statement True or False?
C is a case sensitive language.
What is the output of the following C program?
int main()
{
int var1, var2=2, num=100, a;
if(var1=var2%2) num=2;
a=2;
printf("%d %d", num, var1);
}
Predict the output of the following C code:
#include <stdio.h>
int main()
{
int x = 7;
printf("%d, %d, %d", x, x << 7, x >> 7);
}
C++ is ______________
Creating multiple versions of the same function name that accepts different parameters is called ________.
What is the output of the following code?
void func(char arr[])
{
arr++;
printf("%c", *arr);
arr++;
printf("%c", *arr);
}
int main()
{
char arr[100];
arr[0] = 'U'; arr[1] = 'V'; arr[2] = 'C'; arr[3] = 'E';
func(arr);
}
Which is the correct statement about pure virtual functions?
#include <iostream>
using namespace std;
int main ()
{
int firstvalue = 5, secondvalue = 15;
int * p1, * p2;
p1 = &firstvalue; // p1 = address of firstvalue
p2 = &secondvalue; // p2 = address of secondvalue
*p1 = 10; // value pointed to by p1 = 10
*p2 = *p1; // value pointed to by p2 = value pointed to by p1
p1 = p2; // p1 = p2 (value of pointer is copied)
*p1 = 20; // value pointed to by p1 = 20
cout << firstvalue << '\n';
cout << secondvalue << '\n';
return 0;
}