A constructor that accepts __________ parameters is called the default constructor.
Determine the output of this code?
#include<stdio.h>
int main(){
int i=-3;
int k=i%2;
printf("%d\n",k);
}
What is the output of the following program?
main()
{
struct employee
{
char name[15];
int age;
float sal;
}emp1,emp2;
printf("%d",sizeof(emp1));
}
When a C program is started, O.S environment is responsible for opening file and providing pointer for that file?
What will be the output of the following C code?
#include<stdio.h>
int main()
{
int n = 10;
for(;--n;)
printf("%d", n);
return 0;
}
What will be the output of the following C code?
#include <stdio.h>
int main()
{
while()
printf("In while loop");
printf("After loop");
}
What will be the output of the following C code?
#include<stdio.h>
#include<string.h>
int main()
{
char *str="x";
char c = 'x';
char ary[1];
ary[0]=c;
printf("%d %d", strlen(str), strlen(ary));
return 0;
}
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void square (int *x)
{
*x = (*x + 1) * (*x);
}
int main ( )
{
int num = 10;
square(&num);
cout << num;
return 0;
}
Typecasting is a process of:
Identify the error in the following code.
#include<stdio.h>
int main()
{
int i=0,k=1,l=2,j;
for(j=0;j<5;j++)
{
printf("%d\n",j);
}
}