The maximum combined length of the command-line arguments including the spaces between adjacent arguments is
AnswerWhile calling the fprintf() function in the format string conversion specifier %s can be used to write a character string in capital letters.
AnswerWhat will be the output of the program ?
#include<stdio.h>
int main()
{
FILE *ptr;
char i;
ptr = fopen("myfile.c", "r");
while((i=fgetc(ptr))!=NULL)
printf("%c", i);
return 0;
}
Answer
Point out the error in the program?
struct emp
{
int ecode;
struct emp e;
};
Answer
What will be the output of the program ?
#include<stdio.h>
int main()
{
enum status {pass, fail, absent};
enum status stud1, stud2, stud3;
stud1 = pass;
stud2 = absent;
stud3 = fail;
printf("%d %d %d\n", stud1, stud2, stud3);
return 0;
}
Answer
What will be the output of the program ?
#include<stdio.h>
int main()
{
printf(5+"IndiaBIX\n");
return 0;
}
Answer
Which of the following is correct way to define the function fun() in the below program?
#include<stdio.h>
int main()
{
int a[3][4];
fun(a);
return 0;
}
Answer
What will be the output of the program if the array begins 1200 in memory?
#include<stdio.h>
int main()
{
int arr[]={2, 3, 4, 1, 6};
printf("%u, %u, %u\n", arr, &arr[0], &arr);
return 0;
}
Answer
What will be the output of the program ?
#include<stdio.h>
int main()
{
int i, a[] = {2, 4, 6, 8, 10};
change(a, 5);
for(i=0; i<=4; i++)
printf("%d, ", a[i]);
return 0;
}
void change(int *b, int n)
{
int i;
for(i=0; i<n; i++)
*(b+1) = *(b+i)+5;
}
Answer
What will be the output of the program?
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i=0;
i++;
if(i<=5)
{
printf("IndiaBIX");
exit(1);
main();
}
return 0;
}
Answer
Will the printf() statement print the same values for any values of a?
#include<stdio.h>
int main()
{
float a;
scanf("%f", &a);
printf("%f\n", a+a+a);
printf("%f\n", 3*a);
return 0;
}
Answer
Which of the following range is a valid long double (Turbo C in 16 bit DOS OS) ?
AnswerWhich of the following is the correct order of evaluation for the below expression?
z = x + y * z / 4 % 2 - 1
What will be the output of the program?
#include<stdio.h>
int main()
{
int x=1, y=1;
for(; y; printf("%d %d\n", x, y))
{
y = x++ <= 5;
}
printf("\n");
return 0;
}
Answer
What will be the output of the program under DOS?
#include<stdio.h>
int main()
{
char huge *near *far *ptr1;
char near *far *huge *ptr2;
char far *huge *near *ptr3;
printf("%d, %d, %d\n", sizeof(ptr1), sizeof(**ptr2), sizeof(ptr3));
return 0;
}
Answer
What do the following declaration signify?
int *f();
Answer
Bitwise | can be used to multiply a number by powers of 2.
AnswerIn Turbo C/C++ under DOS if we want that any wild card characters in the command-line arguments should be appropriately expanded, are we required to make any special provision?
AnswerWhat will be the output of the program (sample.c) given below if it is executed from the command line (Turbo C in DOS)?
cmd> sample 1 2 3
/* sample.c */
#include<stdio.h>
int main(int argc, char *argv[])
{
int j;
j = argv[1] + argv[2] + argv[3];
printf("%d", j);
return 0;
}
Answer
On executing the below program what will be the contents of 'target.txt' file if the source file contains a line "To err is human"?
#include<stdio.h>
int main()
{
int i, fss;
char ch, source[20] = "source.txt", target[20]="target.txt", t;
FILE *fs, *ft;
fs = fopen(source, "r");
ft = fopen(target, "w");
while(1)
{
ch=getc(fs);
if(ch==EOF)
break;
else
{
fseek(fs, 4L, SEEK_CUR);
fputc(ch, ft);
}
}
return 0;
}
Answer
© 2017 QuizBucket.org