A) Give the output of the following programs:
i) #include<stdio.h>
void main()
{
char msg[]="Well Done";
for (int k=0; msg[k]; k++)
if (msg[k]==char(32))
msg[k]='*';
else
k%2==0 ? msg[k]++ : --msg[k];
printf(msg);
}
ii) #include<iostream.h>
int z=4;
void f(int& x, int y)
{
x+=y+=z+=x+y+z;
cout<<x<<","<<y<<","<<z<<endl;
}
void main()
{
int z=5;
f(z, ::z);
f(::z, z);
}
B) randomize()
for (int k=0; k<4; k++)
{
int r=5+random(5);
cout<<r;
}
What will the maximum value and minimum value stored in the variable r? What will be the output of the program segment?
i) 8642 ii) 9875 iii) 8769 iv) 3579
C) What is subscript? What is a subscripted variable? What is the restriction to be followed when a 2D array is passed as a parameter to the function?
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment