What is the output of this C++ program?
#include <iostream>
using namespace std;
void print(int i)
{
cout << i;
}
void print(double f)
{
cout << f;
}
int main(void)
{
print(5);
print(500.263);
return 0;
}
What will be the output of below C++ program?
#include <iostream>
using namespace std;
int Add(int X, int Y, int Z)
{
return X + Y;
}
double Add(double X, double Y, double Z)
{
return X + Y;
}
int main()
{
cout << Add(5, 6);
cout << Add(5.5, 6.6);
return 0;
}
What is the output of the following C++ program?
#include <iostream>
using namespace std;
int operate (int a, int b)
{
return (a * b);
}
float operate (float a, float b)
{
return (a / b);
}
int main()
{
int x = 5, y = 2;
float n = 5.0, m = 2.0;
cout << operate(x, y) <<" ";
cout << operate (n, m);
return 0;
}
What will be the output of this C++ code?
#include <iostream>
using namespace std;
class Test
{
public:
Test() { cout << "Hello from Test() "; }
} a;
int main()
{
cout << "Main Started ";
return 0;
}
What is the output of this C code?
#include <stdio.h>
int main()
{
void foo();
printf("1 ");
foo();
}
void foo()
{
printf("2 ");
}
What is the output of this C code?
#include <stdio.h>
int main()
{
void foo(), f();
f();
}
void foo()
{
printf("2 ");
}
void f()
{
printf("1 ");
foo();
}
What is the output of this C code?
#include <stdio.h>
int main()
{
void foo();
void f()
{
foo();
}
f();
}
void foo()
{
printf("2 ");
}
What is the output of this C code?
#include <stdio.h>
void foo();
int main()
{
void foo();
foo();
return 0;
}
void foo()
{
printf("2 ");
}
What is the output of this C code?
#include <stdio.h>
void fun();
int main()
{
void fun(int);
fun(1);
return 0;
}
void fun(int i)
{
printf("2 ");
}
What is the output of this C code?
#include <stdio.h>
void fun();
int main()
{
void fun(int);
fun();
return 0;
}
void fun()
{
printf("2 ");
}
What is the output of this C code?
#include <stdio.h>
void me()
{
printf("hi");
}
int main()
{
me();
}
What is the output of this C code?
#include <stdio.h>
void me();
void ne()
{
me();
}
int main()
{
void me()
{
printf("hi");
}
}
What is the output of this C code?
#include <stdio.h>
void me()
{
printf("hi");
me();
}
int main()
{
me();
}
What is the output of the given C code?
#include <stdio.h>
void fun()
{
return 1;
}
int main()
{
int x = 0;
x = fun();
printf("%d", x);
}
What is the output of this C++ program?
#include <iostream>
using namespace std;
void addprint()
{
static int s = 1;
s++;
cout << s;
}
int main()
{
addprint();
addprint();
addprint();
return 0;
}