Correct Answer : Dennis Ritchie
Correct Answer : 1972
Correct Answer : All of the above
Correct Answer : High level language
Correct Answer : #
Correct Answer : main()
Correct Answer : /* Comment */
Correct Answer : FILE*
Correct Answer : stdio.h
Correct Answer : ;
Correct Answer : 32
Correct Answer : 7
Correct Answer : if ( expression )
Correct Answer : ==
Correct Answer : ::
Correct Answer : repeating
Correct Answer : a = getchar();
Correct Answer : &&
Correct Answer : double
int i = 2 * 3 + 4 * 5; Value of i:
Correct Answer : 26
Correct Answer : _ (underscore)
Correct Answer : 2 byte
Correct Answer : NULL Pointer
Correct Answer : return
Correct Answer : int
Correct Answer : free()
Correct Answer : malloc() takes a single argument while calloc() needs two arguments
Correct Answer : The way memory is allocated
Correct Answer : struct a_struct {int a;};
Correct Answer : All operations are at one end
Correct Answer : int anarray[9];
Correct Answer : Homogenous
Correct Answer : int anarray[20][20];
Correct Answer : gets();
Correct Answer : When there is no memory for adding new name
Correct Answer : strcmp();
Correct Answer : printf("\\n");
main() { int x=20,y=35; x=y++ + x++; y= ++y + ++x; printf("%d%d",x,y); }​
Correct Answer : 5 7 9 4
#include <stdio.h> int main() { FILE *fp; fp = fopen("newfile", "w"); printf("%d\n", ferror(fp)); return 0; }​
Correct Answer : 0
Correct Answer : (char)a;
Correct Answer : ()
Correct Answer : random()
Correct Answer : rand();
Correct Answer : Functions can return any type except array and functions
Correct Answer : int funct(int x) {return x=x+1;}
main () { int i, j, k; i = 3; j =2*(i++); k =2*(++i); }​
which one of the given option is correct?
Correct Answer : j = 6, k = 10.
main() { int a,b,c; a=10; b=20; c=printf("%d",a)+ ++b; printf("\n%d",c); }​
Correct Answer : 23
main() { int i; for(i=9;i;i=i-2) { printf("\n%d",i); } }​
Correct Answer : Infinite
int fun(); extern int fun();​
Correct Answer : Both are identical
Correct Answer : rem = fmod(3.14, 2.1);
float x = 3.3; int i; i = (int) x;​
Correct Answer : 3
Correct Answer : Hash search
extern int i;​
Correct Answer : Declaration
Correct Answer : int *x;
if (1) printf(''A''); else printf(''B'');
Correct Answer : A
for (int x=9; x>0; x/=2) printf(''%d'', x);
Correct Answer : 9421
Correct Answer : float *ptr;
int x=0; switch(x) { case 1: printf( "FTL" ); case 0: printf( "FREE" ); case 2: printf( "TIMELEARN" ); }​
Correct Answer : FREETIMELEARN
Correct Answer : true
Correct Answer : int and float
#include <stdio.h> int main(int argc, char** argv) { int x = 3; printf("%d", x++ + ++x); return 1; }​
Correct Answer : undefined
void main() { int i=0; while(i++<10) { if(i<5 && i<9) continue; printf("\n%d\t",i); } }​
Correct Answer : 5 6 7 8 9 10
Correct Answer : 4
#include <stdio.h> struct temp { int a[10]; char p; };​
Correct Answer : 44
#include <stdio.h> union { int x; char y; }p; int main() { p.y = 60; printf("%d\n", sizeof(p)); }​
Correct Answer : sizeof(char)
Correct Answer : Natural base logarithm
#include <stdio.h> int main() { int a = 4, n, i, result = 0; scanf("%d", n); for (i = 0;i < n; i++) result += a; }​
Correct Answer : Multiplication of a and n
Correct Answer : cc -lm filename.c
Correct Answer : fmod(x);
// Add stdio.h header file in below code int main() { int array[10] = {3, 0, 8, 1, 12, 8, 9, 2, 13, 10}; int x, y, z; x = ++array[2]; y = array[2]++; z = array[x++]; printf("%d %d %d", x, y, z); return 0; }
Correct Answer : 10 9 10
Correct Answer : ceil()
Correct Answer : You can declare a null pointer as char* p = (char*)0
Correct Answer : A bit field cannot be used in a union
Correct Answer : -1.7e-308 to +1.7e-308
// Add stdio.h header file in below code int main() { int x = 6; int y = 4; int z; if(!x >= 5) y = 3; z = 2; printf("%d %d", z, y); return 0; }
Correct Answer : 2 4
// Add stdio.h header file in below code #define PRODUCT(x) (x*x*x*x) int main() { int x = 2; int result = PRODUCT(x++); printf("%d %d", x, result); return 0; }
Correct Answer : 6 120
// Add stdio.h and stdbool.h header files in below code int main() { bool arr[10] = { true, false }; printf( "%ld\n",sizeof(bool) ); return 0; }
Correct Answer : 1
// Add stdio.h header file in below code int main() { const int limit = 10; limit++; printf("%d", limit); return 0; }
Correct Answer : Compile error
// Add stdio.h header file in below code int main() { int number1 = -17; int number2 = -5; int result = number1 % number2; printf("%d",result); return 0; }
Correct Answer : -2
Correct Answer : ceil(4.23)
Correct Answer : Preprocessor directive
Correct Answer : void (*pointer)(int) = &function;
Correct Answer : The structure variable is of auto storage class by default
Correct Answer : p = n * (n-1) / 2 * (n-2) / 3;
// Add stdio.h header file in below code int main() { char result = 125; result = result + 5; printf("%d", result); return 0; }
Correct Answer : -126
Correct Answer : long short d = 40;
int main() { int a = 0; while(a++); { printf("freetimelearning.com "); } return 0; }​
Correct Answer : 1 time
Correct Answer : 31
Correct Answer : int 3_a;
Explanation : Variable name cannot start with a digit.
Correct Answer : int num[6] = { 2, 4, 12, 5, 45, 5 } ;
Correct Answer : Sequential
Correct Answer : prints the error message specified by the compiler
Correct Answer : A & B Both
Correct Answer : Exit from loop or switch statement
Correct Answer : None of the above
Correct Answer : Last In First Out Order
Correct Answer : Tree
Correct Answer : prints ASCII equivalent of 100
Correct Answer : 42
Correct Answer : Search, Insert and Delete Operations
Correct Answer : Singly linked list
Correct Answer : All answers are right
Correct Answer : LowerCase letters
Correct Answer : int my_num = 100000;
Correct Answer : char < int < double
char *p; p = (char*) malloc(100);
Correct Answer : char *p = (char*)malloc(100);
Correct Answer : near=2 far=4 huge=4
a[i][j][k][l]
Correct Answer : *(*(*(*(a+i)+j)+k)+l)
#include<stdio.h> int main() { int i=3, *j, k; j = &i; printf("%d\n", i**j*i+*j); return 0; }
Correct Answer : 30
#include<stdio.h> int main() { int x=30, *y, *z; y=&x; /* Assume address of x is 500 and integer is 4 byte size */ z=y; *y++=*z++; x++; printf("x=%d, y=%d, z=%d\n", x, y, z); return 0; }
Correct Answer : x=31, y=504, z=504
#include<stdio.h> int main() { char str[20] = "Hello"; char *const p=str; *p='M'; printf("%s\n", str); return 0; }
Correct Answer : Mello
#include<stdio.h> int main() { int ***r, **q, *p, i=8; p = &i; q = &p; r = &q; printf("%d, %d, %d\n", *p, **q, ***r); return 0; }
Correct Answer : 8, 8, 8
#include<stdio.h> int main() { printf("%d, %d\n", sizeof(NULL), sizeof("")); return 0; }
Correct Answer : 4, 1
#include<stdio.h> int main() { int a[3][4] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; printf("%u, %u, %u\n", a[0]+1, *(a[0]+1), *(*(a+0)+1)); return 0; }
Correct Answer : 1006, 2, 2
#include<stdio.h> int main() { int arr[3] = {2, 3, 4}; char *p; p = arr; p = (char*)((int*)(p)); printf("%d, ", *p); p = (int*)(p+1); printf("%d", *p); return 0; }
Correct Answer : 2, 0
#include<stdio.h> int main() { char *str; str = "%d\n"; str++; str++; printf(str-2, 300); return 0; }
Correct Answer : 300
#include<stdio.h> int main() { printf("%c\n", 7["FreeTIME"]); return 0; }
Correct Answer : print "X" of FreeTIME
#include<stdio.h> power(int**); int main() { int a=5, *aa; /* Address of 'a' is 1000 */ aa = &a; a = power(&aa); printf("%d\n", a); return 0; } power(int **ptr) { int b; b = **ptr***ptr; return (b); }​
Correct Answer : 25
#include<stdio.h> #include<string.h> int main() { int i, n; char *x="Alice"; n = strlen(x); *x = x[n]; for(i=0; i<=n; i++) { printf("%s ", x); x++; } printf("\n", x); return 0; }
Correct Answer : lice ice ce e
#include<stdio.h> int main() { int arr[] = {12, 13, 14, 15, 16}; printf("%d, %d, %d\n", sizeof(arr), sizeof(*arr), sizeof(arr[0])); return 0; }
Correct Answer : 20, 4, 4
Correct Answer : float ****fun(float***);
#include<stdio.h> int main() { int i=10; int *j=&i; return 0; }
Correct Answer : j is a pointer to an int and stores address of i
#include<stdio.h> int main() { int *j; void fun(int**); fun(&j); return 0; } void fun(int **k) { int a=10; /* Add a statement here */ }
Correct Answer : *k=&a
#include <stdio.h> main() { char *p = 0; *p = 'a'; printf("value in pointer p is %c\n", *p); }​
Correct Answer : Run time error
#include <stdio.h> int main() { int y = 10000; int y = 34; printf("Hello World! %d\n", y); return 0; }
Correct Answer : Compile time error
#include <stdio.h> int main(){ int ThisIsVariableName = 12; int ThisIsVariablename = 14; printf("%d", ThisIsVariablename); return 0; }
Correct Answer : The program will print 14
Correct Answer : volatile
#include <stdio.h> int main(){ int i = 3; int l = i / -2; int k = i % -2; printf("%d %d\n", l, k); return 0; }
Correct Answer : -1 1
#include <stdio.h> void main() { int x = 5 * 9 / 3 + 9; }
Correct Answer : 24
#include <stdio.h> void main() { int x = 0, y = 2, z = 3; int a = x & y | z; printf("%d", a); }
#include <stdio.h> int main() { int i = 10, j = 0; if (i || (j = i + 10)) //do something ; }
#include <stdio.h> int main(){ int a = 1, b = 1, c; c = a++ + b; printf("%d, %d", a, b); }
Correct Answer : a = 2, b = 1
#include <stdio.h> int main() { int a = 10, b = 10; if (a = 5) b--; printf("%d, %d", a, b--); }​
Correct Answer : a = 5, b = 9
#include <stdio.h> int main() { int i = 2; int i = i++ + i; printf("%d\n", i); }
Correct Answer : = operator is not a sequence point
#include <stdio.h> int main() { int i, n, a = 4; scanf("%d", &n); for (i = 0; i < n; i++) a = a * 2; }
Correct Answer : No output
#include <stdio.h> void main() { int x = 4, y, z; y = --x; z = x--; printf("%d%d%d", x, y, z); }
Correct Answer : 2 3 3
#include <stdio.h> void main() { int x = 0; if (x = 0) printf("Its zero\n"); else printf("Its not zero\n"); }
Correct Answer : Its not zero
#include <stdio.h> void main() { 1 < 2 ? return 1: return 2; }
#include <stdio.h> int main() { int x = 2, y = 2; x /= x / y; printf("%d\n", x); return 0; }
Correct Answer : 2
#include <stdio.h> int main() { int x = 1; int y = x == 1 ? getchar(): 2; printf("%d\n", y); }
Correct Answer : Ascii value of character getchar function returns
#include <stdio.h> int main() { int a = 2; int b = 0; int y = (b == 0) ? a :(a > b) ? (b = 1): a; printf("%d\n", y); }
#include <stdio.h> void main() { int k = 8; int m = 7; int z = k < m ? k = m : m++; printf("%d", z); }
#include <stdio.h> int main() { int x = 2, y = 0; int z = y && (y |= 10); printf("%d\n", z); return 0; }
#include <stdio.h> int main() { int y = 2; int z = y +(y = 10); printf("%d\n", z); }
Correct Answer : 20
Correct Answer : all of the mentioned
Correct Answer : a = b = c = d = 5;
Correct Answer : All of the mentioned
#include <stdio.h> void main() { int x = 5; if (true); printf("hello"); }​
Correct Answer : It will throw an error
#include <stdio.h> void main() { int x = 0; if (x == 0) printf("hi"); else printf("how are u"); printf("hello"); }
Correct Answer : hihello
#include <stdio.h> void main() { int ch; printf("enter a value between 1 to 2:"); scanf("%d", &ch); switch (ch, ch + 1) { case 1: printf("1\n"); break; case 2: printf("2"); break; } }
Correct Answer : break
Correct Answer : for (i = n-1; i>-1; i–)
#include <stdio.h> void main() { double k = 0; for (k = 0.0; k < 3.0; k++) printf("Hello"); }
Correct Answer : Hello is printed thrice
#include <stdio.h> int main() { while () printf("In while loop "); printf("After loop\n"); }
Correct Answer : In rewind, there is no way to check if the operations completed successfully
#include <stdio.h> int main() { int i; for (i = 1; i <= 100; i++) { printf("GFG\n"); if (i == 5) break; } return (0); }
Correct Answer : 5 times
#include <stdio.h> int main() { int i; for (i = 1; i <= 10; i++) { printf("welcome\n"); continue; printf("hii"); } return (0); }
Correct Answer : print welcome 10 times
Correct Answer : Only P1 and P2
Correct Answer : void *
Correct Answer : "ptr = calloc(m, n)" is equivalent to following ptr = malloc(m * n); memset(ptr, 0, m * n);
Correct Answer : Both i) and iii) are valid.
#include <stdio.h> int main() { int i = 0; switch (i) { case '0': printf("Free"); break; case '1': printf("Time"); break; default: printf("FreeQuiz"); } return 0; }​
Correct Answer : FreeQuiz
#include <stdio.h> #define EVEN 0 #define ODD 1 int main() { int i = 3; switch (i & 1) { case EVEN: printf("Even"); break; case ODD: printf("Odd"); break; default: printf("Default"); } return 0; }
Correct Answer : Odd
struct { short s[5]; union { float y; long z; }u; } t;
Correct Answer : 18 bytes
#include <stdio.h> int i; int main() { extern int i; if (i == 0) printf("scope rules\n"); }
Correct Answer : scope rules
#include <stdio.h> int main() { extern ary1[]; printf("%d\n", ary1[0]); }
Correct Answer : Compile time error because datatype of array is not provided
Correct Answer : From the point of declaration to the end of the file being compiled
#include <stdio.h> int main() { int i; for (i = 0;i < 5; i++) int a = i; printf("%d", a); }
Correct Answer : Syntax error in declaration of a
#include <stdio.h> #define foo(m, n) m ## n int main() { printf("%s\n", foo(k, l)); }
#include <stdio.h> #define foo(x, y) x / y + x int main() { int i = -6, j = 3; printf("%d\n",foo(i + j, 3)); return 0; }
Correct Answer : -8
#include <stdio.h> #define foo(x, y) x / y + x int main() { int i = -6, j = 3; printf("%d ", foo(i + j, 3)); printf("%d\n", foo(-3, 3)); return 0; }
Correct Answer : -8 -4
Correct Answer : Data type is flexible
Correct Answer : True
Correct Answer : Line control
Correct Answer : They can include all types of file
Correct Answer : #elif
Correct Answer : Then the code up to the following #else or #elif or #endif is compiled
#include <stdio.h> int x; void main() { printf("%d", x); }
Correct Answer : External
#include <stdio.h> int main() { printf("%d", d++); } int d = 10;
#include <stdio.h> int func() { return (double)(char)5.0; }
int func(int); double func(int); int func(float);
int (*a)[7];​
Correct Answer : A pointer “a” to an array
Correct Answer : a1 is P, a2 is P
Correct Answer : Jagged Array
#include <stdio.h> int main() { double *ptr = (double *)100; ptr = ptr + 2; printf("%u", ptr); }
Correct Answer : 116
Correct Answer : a – b
#include <stdio.h> void main() { char *s = "hello"; char *p = s; printf("%c\t%c", *p, s[1]); }
Correct Answer : h e
#include <stdio.h> int main() { char *str = "hello, world\n"; char *strc = "good morning\n"; strcpy(strc, str); printf("%s\n", strc); return 0; }
Correct Answer : Crash/segmentation fault
#include <stdio.h> int main() { char str[] = "hello, world"; str[5] = '.'; printf("%s\n", str); return 0; }
Correct Answer : hello. world
#include <stdio.h> int main() { char *str = "hello world"; char strary[] = "hello world"; printf("%d %d\n", strlen(str), strlen(strary)); return 0; }
Correct Answer : 11 11
#include <stdio.h> void fun(char *k) { printf("%s", k); } void main() { char s[] = "hello"; fun(s); }
Correct Answer : hello
#include <stdio.h> int main() { int a = 1, b = 2, c = 3; int *ptr1 = &a, *ptr2 = &b, *ptr3 = &c; int **sptr = &ptr1; //-Ref *sptr = ptr2; }
Correct Answer : ptr1 points to b
Correct Answer : The definition only allocates 10 pointers and does not initialize them & Initialization must be done explicitly
#include <stdio.h> void main() { char a[10][5] = {"hi", "hello", "fellows"}; printf("%d", sizeof(a[1])); }
Correct Answer : 5
#include <stdio.h> int main() { char a[1][5] = {"hello"}; printf("%s", a[0]); return 0; }
Correct Answer : Undefined behaviour
#include <stdio.h> int main() { char *a[1] = {"hello"}; printf("%s", a[0]); return 0; }
Correct Answer : P are dynamic, Q are static
Correct Answer : argument count, argument vector
Correct Answer : A pointer to an array of character strings that contain the arguments, one per string
Correct Answer : The name by which the program was invoked
Correct Answer : void pass(int (*fptr)(int, float, char)){}
#include <stdio.h> void first() { printf("Hello World"); } void main() { void *ptr() = first; ptr++ ptr(); }
Correct Answer : Illegal application of ++ to void data type & pointer function initialized like a variable
#include <stdio.h> void f(int (*x)(int)); int myfoo(int); int (*fooptr)(int); int ((*foo(int)))(int); int main() { fooptr = foo(0); fooptr(10); } int ((*foo(int i)))(int) { return myfoo; } int myfoo(int i) { printf("%d\n", i + 1); }
Correct Answer : 11
#include <stdio.h> struct student { int no = 5; char name[20]; }; void main() { struct student s; s.no = 8; printf("hello"); }
int (*(*y)())[2];
Correct Answer : y is pointer to the function which returns pointer to integer array
Correct Answer : structures
Correct Answer : Function
#include <stdio.h> struct student { int no; char name[20]; } void main() { struct student s; s.no = 8; printf("hello"); }
#include <stdio.h> void main() { struct student { int no; char name[20]; }; struct student s; s.no = 8; printf("%d", s.no); }
Correct Answer : 8
#include <stdio.h> struct student { char *name; }; void main() { struct student s, m; s.name = "st"; m = s; printf("%s%s", s.name, m.name); }
Correct Answer : st st
Correct Answer : None of the mentioned
Correct Answer : Typecasting of structure
Correct Answer : Structure
#include <stdio.h> struct p { int x; char y; }; typedef struct p* q*; int main() { struct p p1[] = {1, 92, 3, 94, 5, 96}; q ptr1 = p1; printf("%d\n", ptr1->x); }
Correct Answer : *my_struct.b = 10;
Correct Answer : Compiler can access entire structure from the function
#include <stdio.h> union temp { int a; float b; char c; }; union temp s = {1,2.5,’A’}; //REF LINE
Correct Answer : a
#include <stdio.h> union u_tag { int ival; float fval; char *sval; } u;
Correct Answer : Will be large enough to hold the largest of the three types;
#include <stdio.h> struct { char *name; union { char *sval; } u; } symtab[10];
Correct Answer : Both *symtab[i].u.sval & symtab[i].u.sval[0].
#include <stdio.h> struct student { char a[5]; }; void main() { struct student s[] = {"hi", "hey"}; printf("%c", s[0].a[1]); }
Correct Answer : i
#include <stdio.h> void main() { int lookup[100] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; printf("%d", lookup[3]); }
Correct Answer : scanf
Correct Answer : The next input character each time it is called EOF when it encounters end of file
Correct Answer : Both character written & EOF if an error occurs
Correct Answer : The symbolic constant EOF is defined in <stdio.h> & value is -1
#include <stdio.h> int main() { int i = 10, j = 2; printf("%d\n", printf("%d %d ", i, j)); }
Correct Answer : 10 2 5
#include <stdio.h> int main() { int i = 10, j = 3; printf("%d %d %d", i, j); }
Correct Answer : 10 3 some garbage value
#include <stdio.h> int main(int argc, char** argv) { char *s = "myworld"; int i = 3; printf("%10.*s", i, s); }