<<= Back Next =>>
You Are On Multi Choice Question Bank SET 185

9251. What will be the output of the program? #include<stdio.h> int main() { int i; char c; for(i=1; i<=5; i++) { scanf("%c", &c); / given input is 'a' / printf("%c", c); ungetc(c, stdin); } return 0; }





9252. Point out the error in the following program. #include<stdio.h> int main() { fprintf("IndiaBIX"); printf("%.ef", 2.0); return 0; }





9253. Point out the error in the following program. #include<stdio.h> #include<string.h> int main() { char str1[] = "Learn through IndiaBIX\0.com", str2[120]; char p; p = (char) memccpy(str2, str1, 'i', strlen(str1)); p = '\0'; printf("%s", str2); return 0; }





9254. Point out the error in the following program. #include<stdio.h> int main() { char str[] = "IndiaBIX"; printf("%.#s %2s", str, str); return 0; }





9255. It is necessary that for the string functions to work safely the strings must be terminated with '\0'.



9256. FILE is a structure suitably typedef'd in "stdio.h".



9257. ftell() returns the current position of the pointer in a file stream.



9258. Data written into a file using fwrite() can be read back using fscanf()



9259. If the two strings are found to be unequal then strcmp returns difference between the first non-matching pair of characters.



9260. Is standard library a part of C language?



9261. Will the program outputs "IndiaBIX.com"? #include<stdio.h> #include<string.h> int main() { char str1[] = "IndiaBIX.com"; char str2[20]; strncpy(str2, str1, 8); printf("%s", str2); return 0; }



9262. The itoa function can convert an integer in decimal, octal or hexadecimal form to a string.



9263. The prototypes of all standard library string functions are declared in the file string.h.



9264. scanf() or atoi() function can be used to convert a string like "436" in to integer.



9265. What will the function rewind() do?





9266. Input/output function prototypes and macros are defined in which header file?





9267. Which standard library function will you use to find the last occurance of a character in a string in C?





9268. What is stderr ?





9269. Does there any function exist to convert the int or float to a string?



9270. I................stand in the rain for long.





9271. Science is full -------- wonders.





9272. I would hurry up, if I _______ you.





9273. Our neighbours have been living here - 1996





9274. You............cross the road when the lights are red.





9275. What will be the output of the program? #include<stdio.h> #include<stdlib.h> int main() { int p; p = (int )malloc(20); / Assume p has address of 1314 / free(p); printf("%u", p); return 0; }





9276. What will be the output of the program (16-bit platform)? #include<stdio.h> #include<stdlib.h> int main() { int p; p = (int )malloc(20); printf("%d\n", sizeof(p)); free(p); return 0; }





9277. What will be the output of the program? #include<stdio.h> #include<string.h> int main() { char s; char fun(); s = fun(); printf("%s\n", s); return 0; } char fun() { char buffer[30]; strcpy(buffer, "RAM"); return (buffer); }





9278. What will be the output of the program? #include<stdio.h> #include<stdlib.h> int main() { union test { int i; float f; char c; }; union test t; t = (union test )malloc(sizeof(union test)); t->f = 10.10f; printf("%f", t->f); return 0; }





9279. Assume integer is 2 bytes wide. How many bytes will be allocated for the following code? #include<stdio.h> #include<stdlib.h> #define MAXROW 3 #define MAXCOL 4 int main() { int (p)[MAXCOL]; p = (int () [MAXCOL])malloc(MAXROW sizeof(p)); return 0; }





9280. Assume integer is 2 bytes wide. What will be the output of the following code? #include<stdio.h> #include<stdlib.h> #define MAXROW 3 #define MAXCOL 4 int main() { int (p)[MAXCOL]; p = (int () [MAXCOL])malloc(MAXROW sizeof(p)); printf("%d, %d\n", sizeof(p), sizeof(p)); return 0; }





9281. How many bytes of memory will the following code reserve? #include<stdio.h> #include<stdlib.h> int main() { int p; p = (int )malloc(256 256); if(p == NULL) printf("Allocation failed"); return 0; }





9282. Point out the error in the following program. #include<stdio.h> #include<stdlib.h> int main() { int a[3]; a = (int) malloc(sizeof(int)3); free(a); return 0; }





9283. Point out the error in the following program. #include<stdio.h> #include<stdlib.h> int main() { char ptr; ptr = (char)malloc(30); strcpy(ptr, "RAM"); printf("%s", ptr); free(ptr); return 0; }





9284. Point out the correct statement will let you access the elements of the array using 'p' in the following program? #include<stdio.h> #include<stdlib.h> int main() { int i, j; int(p)[3]; p = (int()[3])malloc(3sizeof(p)); return 0; }





9285. Which of the following statement is correct prototype of the malloc() function in c ?





9286. Point out the correct statement which correctly free the memory pointed to by 's' and 'p' in the following program? #include<stdio.h> #include<stdlib.h> int main() { struct ex { int i; float j; char s }; struct ex p; p = (struct ex )malloc(sizeof(struct ex)); p->s = (char)malloc(20); return 0; }





9287. Point out the correct statement which correctly allocates memory dynamically for 2D array following program? #include<stdio.h> #include<stdlib.h> int main() { int p, i, j; / Add statement here / for(i=0; i<3; i++) { for(j=0; j<4; j++) { p[i4+j] = i; printf("%d", p[i4+j]); } } return 0; }





9288. malloc() returns a float pointer if memory is allocated for storing float's and a double pointer if memory is allocated for storing double's.



9289. malloc() allocates memory from the heap and not from the stack.



9290. malloc() returns a NULL if it fails to allocate the requested memory.



9291. If malloc() successfully allocates memory it returns the number of bytes it has allocated.



9292. Can I increase the size of dynamically allocated array?



9293. Can I increase the size of statically allocated array?



9294. When we dynamically allocate memory is there any way to free memory during run time?



9295. Which header file should be included to use functions like malloc() and calloc()?





9296. What function should be used to free the memory allocated by calloc() ?





9297. How will you free the memory allocated by the following program? #include<stdio.h> #include<stdlib.h> #define MAXROW 3 #define MAXCOL 4 int main() { int p, i, j; p = (int ) malloc(MAXROW sizeof(int)); return 0; }





9298. Specify the 2 library functions to dynamically allocate memory?





9299. When I was postd to the Cochin office after the training in Madras, I asked my Bank in Madras to ............ my account to Cochin





9300. Water _____ at a temperature of 100ยบ C.





<<= Back Next =>>
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution