Which data type cannot be used in a switch-case statement?
Which of the following data type will throw an error on modulus operation(%)?
Which C++ header file contains the declaration of the min and max functions?
What do we need to do to a pointer to overload the subscript operator?
How do access specifiers in classes help with Abstraction?
What will be the new value of x in the following C++ code?
#include <iostream>
using namespace std;
void fun(int &x)
{
x = 20;
}
int main()
{
int x = 10;
fun(x);
cout << "New value of x is " << x;
return 0;
}
What will be the output of the following C code?
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char str[20];
int res;
strcpy(str, "123456");
res=atoi(str);
printf("%s %d\n",str,res);
What will be the output of the following C++ code?
#include
using namespace std;
void work()
{
cout << "Inside work \n";
}
void test()
{
return work();
}
int main()
{
test();
return 0;
}
Replace the error in the following C code.
#include<stdio.h>
int main()
{
int a=5,c=2,d=4,n=6;
float ans;
ans=10.2/a+(2*a+(3c+4)/a*d/(12/n);
printf("%f",ans);
return 0;
}
Which of the following is correct about new and malloc?