0% found this document useful (0 votes)
78 views2 pages

CSO Lab Viva Questions

Research data for viva

Uploaded by

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

CSO Lab Viva Questions

Research data for viva

Uploaded by

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

1.Predict the output 4.

Predict the output


#include<stdio.h> # include <stdio.h>
int main() int main()
{ {
int n; int i=0;
for(n = 7; n!=0; n- -) for(i=0; i<20; i++)
printf("n = %d", n- -); {
return 0; switch(i)
} {
case 0:
2.Predict the output i+=5;
char *getString() case 1:
{ i+=2;
char *str = "Nice test for strings"; case 5:
return str; i+=5;
} default:
i+=4;
int main() break;
{ }
printf("%s", getString()); printf("%d ", i);
return 0; }
} return 0;
}

3.Predict the output 5.Predict the output


#include<stdio.h>
int main() int x = 0;
int f()
{
{
static int var = 5; return x;
printf("%d ",var--); }
if(var)
main(); int g()
} {
int x = 1;
6. Correct the indentation of the code: return f();
int main() }
{
int t; int main()
scanf("%d", &t); {
while(t--) printf("%d", g());
{ printf("\n");
for(int i=0;i<n;i++) }
{
if(x>=l && y<=r)
{
sum = (sum+1)%mod);
}
}
printf("%d\n", sum);
}
return 0;
}

You might also like