BOP Lab Viva
BOP Lab Viva
BOP Lab Viva
a. 4525
b. 2525
c. 4545
d. None of the these
3) What is the output of this statement "printf("%d", (a++))"?
a. The value of (a + 1)
b. The current value of a
c. Error message
d. Garbage
4) Which of the following function can be used to terminate the main() function
from another function safely?
a. return(expr);
b. exit(expr);
c. abort();
#include <stdio.h>
int main() {
int i, j;
printf("Enter an uppercase character you want to print in the last row: ");
scanf("%c", &input);
++alphabet;
printf("\n");
return 0;
a. A
AB
ABC
ABCD
ABCDE
b. A
BB
CCC
DDDD
EEEEE
c. A
BB
CBC
DBCD
EBCDE
d. A
AA
ABA
ACCA
ADDDA
6) Which of the following will copy the null-terminated string that is in array
src into array dest?
a. dest = src;
b. dest == src;
c. strcpy(dest, src);
d. strcpy(src, dest);
7) what will be the output of the program?
#include<stdio.h>
void main ()
{
Int a[5] = {5, 1, 15, 20, 25};
Int i, j, m;
i = ++a[1];
j = a[1]++;
m = a[i++];
Printf(“%d, %d, %d” , I, j, m);
}
a. 3, 2, 15
b. 2, 3, 20
c. 2, 1, 15
d. 1, 2, 5
8) Which is valid expression in c language?
int main()
printf("a=%d b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("a=%d b=%d",a,b);
return 0;
a. a = 20, b = 20
b. a = 10, b = 20
c. a = 20, b = 10
d. a = 10, b = 10
#include<stdio.h>
#include<stdlib.h>
int main()
unsigned char;
FILE *fp;
fp=fopen("trial", "r");
if(!fp)
exit(1);
}
fclose(fp);
return 0;
c. No error
d. None of above