CSC 203 Question
CSC 203 Question
a) Steve Jobs
b) James Gosling
c) Dennis Ritchie
d) Rasmus Lerdorf
View Answer
ADVERTISEMENT
a) int number;
b) float rate;
c) int variable_count;
d) int $main;
View Answer
a) LowerCase letters
b) UpperCase letters
c) CamelCase letters
View Answer
4. Which of the following is true for variable names in C?
View Answer
View Answer
a) volatile
b) true
c) friend
d) export
View Answer
advertisement
7. What is short int in C programming?
b) Qualifier
View Answer
a) String str;
b) char *str;
View Answer
9. Which keyword is used to prevent any changes in the variable within a C program?
a) immutable
b) mutable
c) const
d) volatile
View Answer
a) True or False
b) 0 or 1
View Answer
a) Widening conversions
b) Narrowing conversions
View Answer
View Answer
a) for
b) while
c) do-while
View Answer
advertisement
a) true
b) false
View Answer
a) Internal
b) External
View Answer
18. Property which allows to produce different executable for different platforms in C is called?
a) File inclusion
b) Selective inclusion
c) Conditional compilation
d) Recursive macros
View Answer
a) Preprocessor directive
b) Inclusion directive
View Answer
advertisement
20. C preprocessors can have compiler specific features.
a) True
b) False
View Answer
a) #ifdef
b) #define
c) #endif
View Answer
a) #
b) $
c) ” ”
d) &
View Answer
23. How is search done in #include and #include “somelibrary.h” according to C standard?
a) When former is used, current directory is searched and when latter is used, standard directory is
searched
b) When former is used, standard directory is searched and when latter is used, current directory is
searched
c) When former is used, search is done in implementation defined manner and when latter is used,
current directory is searched
View Answer
24. How many number of pointer (*) does C have against a pointer variable declaration?
a) 7
b) 127
c) 255
d) No limits
View Answer
a) Jagged Array
b) Rectangular Array
c) Cuboidal Array
d) Multidimensional Array
View Answer
a) char *
b) struct
c) void
27. The standard header _______ is used for variable list arguments (…) in C.
a) <stdio.h >
b) <stdlib.h>
c) <math.h>
d) <stdarg.h>
View Answer
28. When a C program is started, O.S environment is responsible for opening file and providing pointer
for that file?
a) Standard input
b) Standard output
c) Standard error
View Answer
a) int
b) char *
c) struct
View Answer
a) 1 bit
b) 2 bits
c) 1 Byte
d) 2 Bytes
View Answer
a) ,
b) sizeof()
c) ~
View Answer
a) stdlib. h
b) ctype. h
c) stdio. h
d) stdarg. h
View Answer
fp = fopen("Random.txt", "a");
a) Attach
b) Append
c) Apprehend
d) Add
View Answer
#include <stdio.h>
int main()
int y = 10000;
int y = 34;
return 0;
b) Hello World! 34
View Answer
#include <stdio.h>
int main()
int main = 3;
printf("%d", main);
return 0;
View Answer
#include <stdio.h>
int main()
chr = 128;
printf("%d\n", chr);
return 0;
a) 128
b) -128
View Answer
37. What will be the output of the following C code on a 64 bit machine?
#include <stdio.h>
union Sti
int nu;
char m;
};
int main()
union Sti s;
printf("%d", sizeof(s));
return 0;
a) 8
b) 5
c) 9
d) 4
View Answer
#include <stdio.h>
int k;
k = m;
printf("%d\n", k);
return 0;
a) 0
c) 1
d) 8
View Answer
#include <stdio.h>
printf("Sanfoundry.com");
return 0;
void main()
print();
}
b) Sanfoundry.com
View Answer
#include <stdio.h>
int main()
return 0;
a) Yes
b) No
d) Error
View Answer
#include <stdio.h>
void main()
{
int x = 5 * 9 / 3 + 9;
a) 3.75
b) Depends on compiler
c) 24
d) 3
View Answer
42. What will be the output of the following C code? (Initial values: x= 7, y = 8)
#include <stdio.h>
void main()
float x;
int y;
a) 7.000000, 7
c) 7.000000, junk
d) Varies
View Answer
43. What will be the output of the following C code considering the size of a short int is 2, char is 1 and
int is 4 bytes?
#include <stdio.h>
int main()
char c = 97;
return 0;
a) 2, 1, 2
b) 2, 1, 1
c) 2, 1, 4
d) 2, 2, 8
View Answer
int main()
int d, a = 1, b = 2;
d = a++ + ++b;
int main()
int d, a = 1, b = 2;
d = a++ +++b;
a) No difference as space doesn’t make any difference, values of a, b, d are same in both the case
#include <stdio.h>
void main()
a) returns 1
b) returns 2
c) Varies
a) 2
b) True
c) 1
d) 0
#include <stdio.h>
int main()
reverse(1);
void reverse(int i)
if (i > 5)
return ;
a) 1 2 3 4 5
b) Segmentation fault
c) Compilation error
d) Undefined behaviour
48. What will be the final values of i and j in the following C code?
#include <stdio.h>
int x = 0;
int f()
if (x == 0)
return x + 1;
else
return x - 1;
int g()
return x++;
int main()
View Answer
n = 1;
a) Output will be 3, 2
b) Output will be 3, 1
c) Output will be 6, 1
#include <stdio.h>
int main()
int i = 0;
while (i < 3)
i++;
a) 2
b) 3
c) 4
d) 1
#include <stdio.h>
int main()
int i = 0;
do
i++;
if (i == 2)
continue;
printf("%d\n", i);
a) In while loop 2
b) In while loop in while loop 3
c) In while loop 3
d) Infinite loop
52. What will be the data type returned for the following C function?
#include <stdio.h>
int func()
return (double)(char)5.0;
a) char
b) int
c) double
int func(int);
double func(int);
int func(float);
string p = "HELLO";
printf(“%10s”, state);
56. What are the elements present in the array of the following C code?
b) 5, 0, 0, 0, 0
57. What will be the output of the following C function when EOF returns?
58. Which part of the program address space is p stored in the following C code?
#include <stdio.h>
int *p;
int main()
int i = 0;
p = &i;
return 0;
}
a) Code/text segment
b) Data segment
c) Bss segment
d) Stack
a)
#if
#else
#endif
b)
#if
#elif
#endif
c)
#if
#if
#endif
d)
#if
#undef
#endif
#include <stdio.h>
main()
char *p = 0;
*p = 'a';
a) It will print a
b) It will print 0
#include <stdio.h>
main()
else
printf("False");
a) True
b) False
#include <stdio.h>
main()
p[0] = 'a';
p[1] = 'b';
printf("%s", p);
a) abnfoundry C-Test
b) Sanfoundry C-Test
int main()
float f = 0.1;
if (f == 0.1)
printf("True");
else
printf("False");
a) True
b) False
#include <stdio.h>
main()
int n = 0, m = 0;
if (n > 0)
if (m > 0)
printf("True");
else
printf("False");
}
a) True
b) False