In C/CPP Programming ‘\a’ is used for
How many times is 'Abekus' printed?
In C++, what is the sign of the char data type by default?
If the memory space dynamically allocated by malloc() is insufficient, the function returns ______.
Which member function can be called using the class name (instead of an object)?
char inchar = 'A';
switch (inchar)
{
case 'A':
printf("A");
case 'B':
printf("B");
default:
printf("Q");
}
What will be the output of the following C program?
#include <stdio.h>
int main()
{
if (~0 == 1)
printf("yes\n");
else
printf("no\n");
}
What will be the output?
#include <iostream>
using namespace std;
int main()
{
int i, j;
j = 10;
i = (j++, j++, j++);
cout<<i;
return 0;
}
What would be the output of the following C program?
int main()
{
struct strt
{
int num=3;
char name[]="UVCE";
};
struct strt *s;
printf("%d ", s->num);
printf("%s", s->name);
}
// overloading members on constness
#include <iostream>
using namespace std;
class MyClass {
int x;
public:
MyClass(int val) : x(val) {}
const int& get() const {return x;}
int& get() {return x;}
};
int main() {
MyClass foo (10);
const MyClass bar (20);
foo.get() = 15; // ok: get() returns int&
// bar.get() = 25; // not valid: get() returns const int&
cout << foo.get() << '\n';
cout << bar.get() << '\n';
return 0;
}