0% found this document useful (0 votes)
102 views3 pages

Test Case 1 Test Case 2 Test Case 3: Input Output

The document contains important questions about programming concepts like operators, object-oriented programming, call by value vs call by reference, and string handling functions. It also includes sample code snippets and test cases to practice filling in blanks to achieve desired outputs related to functions, macros, and references.

Uploaded by

Venkat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views3 pages

Test Case 1 Test Case 2 Test Case 3: Input Output

The document contains important questions about programming concepts like operators, object-oriented programming, call by value vs call by reference, and string handling functions. It also includes sample code snippets and test cases to practice filling in blanks to achieve desired outputs related to functions, macros, and references.

Uploaded by

Venkat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

IMPORTANT QUESTIONS

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 ",func(i+j, 3));


# undef func // Fill the blank

printf("%d\n",func(i+j,3));
}
int func(int x, int y) {
return x / y + x;
}

4. Operators and implement in a program


5. String Handling Functions

6. Difference between Object Based Program, Object Oriented Program, Procedure Oriented Program

7. Concepts of OOPs.

8. Benefits of OOPs

9. Call by value and call by reference

10.

You might also like