CBSE Worksheets For Class 12 Computer Science Class, Object, Constructor and Distructor
CBSE Worksheets For Class 12 Computer Science Class, Object, Constructor and Distructor
(7) Go through the C++ code shown (8) int A[][4] = {{11,21,32,43},
below, and find out the possible {20,30,40,50}};
output or outputs from the suggested for (int i = 1; i<2; i++)
Output Options (i) to (iv). Also, write for (int j = 0; j<4; j++)
the minimum and maximum values, cout<<A[i][j]<<”*\n”;
which can be assigned to the variable
MyNum.
#include
#include (9) int a = 5;
void main ( ) void demo(int x, int y, int &z)
{ { a += x+y;
randomize ( ) ; z = a+y;
int MyNum, Max=5; y += x;
MyNum = 20 + random (Max) ; cout<<x<<’*'<<y<<’*'<<z<<endl;
for (int N=MyNum; N<=25;N++) }
cout<N<”*”; void main()
} { int a = 3, b = 4;
(i) 20*21*22*23*24*25 demo(::a,a,b);
(ii) 22*23*24*25* demo(::a,a,b);
(iii) 23*24* }
(iv) 21*22*23*24*25
{ int a = 2, b = 5;
demo(::a,a,b);
demo(::a,a,b);
}