Test Case 1 Test Case 2 Test Case 3: Input Output
Test Case 1 Test Case 2 Test Case 3: Input Output
1. Fill up the blanks with appropriate keyword to get the desired output
according to the test cases.
Sample Test Cases
Input Output
Test Case 1 4 Square = 16, ++ Square = 25
Test Case 2 -8 Square = 64, ++ Square = 49
Test Case 3 -10.5 Square = 100, ++ Square = 81
#include <iostream>
using namespace std;
int SQUARE(int x) {x= x * x; }
int main() {
int a , b, c;
cin >> a ;
b = SQUARE(a);
cout << "Square = " << b << ", ";
c = SQUARE(++a);
cout << "++ Square = " << c ;
return 0;
}
2.Fill up the blanks by providing appropriate return type and argument type for the
function Ref_func() to get the desired output according to the test cases.
Sample Test Cases
Input Output
8 9 9
Test Case 1 -9 -9 9
10 11 11
Test Case 2 20 20 11
-19 -18 -18
Test Case 3 -32 -32 -18
#include <iostream>
using namespace std;
int& Ref_func(int & param) {
return (++param);
}
int main() {
int x, y, z;
cin >> x ;
cin >> z ;
y = Ref_func(x);
cout << x << " "<< y << endl;
Ref_func(x) = z;
cout << x << " "<< y;
return 0;
}
3.Read the instruction and Fill up the blanks to get the desired output
according to the test cases.
Sample Test Cases
Input Output
-6
Test Case 1 -8 -4
3
11
Test Case 2 42 34
15
-4
Test Case 3 -18 -16
-8
#include <stdio.h>
int func(int, int);
#define func(x,y) x/y+x // Complete the Macro definition
int main() {
int i,j;
scanf("%d", &i);
scanf("%d", &j);
printf("%d\n",func(i+j,3));
}
int func(int x, int y) {
return x / y + x;
}
6. Difference between Object Based Program, Object Oriented Program, Procedure Oriented Program
7. Concepts of OOPs.
8. Benefits of OOPs
10.