CSE MCQs :: C-MCQs
-
Comment on the output of this C code?
int main()
{
int a[5] = {1, 2, 3, 4, 5};
int i;
for (i = 0; i < 5; i++)
if ((char)a[i] == '5')
printf("%d\n", a[i]);
else
printf("FAIL\n");
} - Which data type is most suitable for storing a number 65000 in a 32-bit system?
- Which of the following is a User-defined data type?
- What is the size of an int data type?
-
What is the output of this C code?
int main()
{
char chr;
chr = 128;
printf("%d\n", chr);
return 0;
} -
Comment on the output of this C code?
int main()
{
char c;
int i = 0;
FILE *file;
file = fopen("test.txt", "w+");
fprintf(file, "%c", 'a');
fprintf(file, "%c", -1);
fprintf(file, "%c", 'b');
fclose(file);
file = fopen("test.txt", "r");
while ((c = fgetc(file)) != -1)
printf("%c", c);
return 0;
. } - What is short int in C programming?
-
Comment on the output of this C code?
int main()
{
float f1 = 0.1;
if (f1 == 0.1)
printf("equal\n");
else
printf("not equal\n");
} -
Comment on the output of this C code?
int main()
{
float f1 = 0.1;
if (f1 == 0.1f)
printf("equal\n");
else
printf("not equal\n");
}