What is the output of the following C program?
#include<stdio.h>
int i;
void fun()
{
i++;
}
int main()
{
i=5;
fun();
printf("%d",i);
}
What is the concept of two functions with the same name called?
If you do not place a parenthesis after the keyword 'main', what error will be generated?
What is the purpose of an adapter in the C++ Standard Template Library (STL)?
What will be the output of the following C code?
#include<stdio.h>
int main()
{
int x = 0;
int *ptr = &x;
printf("%d\n", *ptr);
return 0;
}
Which of the following is/are true about virtual functions?
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;
}
What will be the output of the following C++ code?
#include <iostream>
#include <cctype>
using namespace std;
int main(int argc, char const *argv[])
{
char arr[12] = "H3ll0\tW0r1d";
for(int i=0;i<12;i++)
{
cout<<(bool)iscntrl(arr[i]);
}
}
What will be the output of the following C++ code?
#include <stdio.h>
#include<iostream>
using namespace std;
int array1[] = {1200, 200, 2300, 1230, 1543};
int array2[] = {12, 14, 16, 18, 20};
int temp, result = 0;
int main()
{
for (temp = 0; temp < 5; temp++)
{
result += array1[temp];
}
for (temp = 0; temp < 4; temp++)
{
result += array2[temp];
}
cout << result;
return 0;
}