16.
What happens if the following program is executed in C and C++?
#include<stdio.h>
int main()
{
abc();
}
int abc()
{
printf(“Hello World”);
return 0;
}
a) Error in both C and C++
b) Warning in both C and C++
c) Error in C++ but Warning in C
d) Error in C but Warning in C++
17.
What happens if the following line is executed in C and C++?
int *p = malloc(10);
a) Error in both C and C++
b) Warning in both C and C++
c) Error in C++ and successful execution in C
d) Error in C and successful execution in C++
18.
What happens if the following line is executed in C and C++?
const int a;
a) Error in both C and C++
b) Warning in both C and C++
c) Error in C and successful execution in C++
d) Error in C++ and successful execution in C
19.
What happens if the following program is executed in C and C++?
#include <stdio.h>
int main(void)
{
int new = 5;
printf(“%d”, new);
}
a) Error in both C and C++
b) A successful run in both C and C++
c) Error in C and successful execution in C++
d) Error in C++ and successful execution in C
20.
What happens if the following program is executed in C and C++?
#include <stdio.h>
void main()
{
printf(“Hello World”);
}
a) Error in both C and C++
b) Successful run in both C and C++
c) Error in C and successful execution in C++
d) Error in C++ and successful execution in C