#include<stdio.h>
int main()
{
int x;
x=25;
printf("%d\n",x);
}
What will be the output?
#define x 10
#include <stdio.h>
int main()
{
x = 20;
printf("%d", x);
return 0;
}
What is the output of the following program?
int main()
{
char a[]={'7','8','9','\0'};
char b[]={'9','8','7','\0','7','8','9'};
printf("%s\n%s", a, b);
}
Which of the following syntax for declaring a variable of struct STRUCT can be used in both C and C++?
Which of the following statements is true?
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
int a[2][4] = {3, 6, 9, 12, 15, 18, 21, 24};
cout << *(a[1] + 2) << *(*(a + 1) + 2) << 2[1[a]];
return 0;
}
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
float f1 = 0.5;
double f2 = 0.5;
if (f1 == 0.5f)
cout << "equal";
else
cout << "not equal";
return 0;
What is the output of the below code considering size of short int is 2, char is 1 and int is 4 bytes?
int main()
{
short int i = 20;
char c = 97;
printf("%d, %d, %d\n", sizeof(i), sizeof(c), sizeof(c + i));
return 0;
}
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void copy (int& a, int& b, int& c)
{
a *= 2;
b *= 2;
c *= 2;
}
int main ()
{
int x = 1, y = 3, z = 7;
copy (x, y, z);
cout << "x =" << x << ", y =" << y << ", z =" << z;
return 0;
}