Question Set

1. Which of the following statements are correct about the program? #include<stdio.h> char fun(unsigned int num, int base); int main() { char s; s=fun(128, 2); s=fun(128, 16); printf("%s\n",s); return 0; } char fun(unsigned int num, int base) { static char buff[33]; char ptr = &buff[sizeof(buff)-1]; ptr = '\0'; do { --ptr = "0123456789abcdef"[num %base]; num /=base; }while(num!=0); return ptr; }





Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

Show Similar Question And Answers
QA->Two statements are given followed by two conclusions I and II. You have to consider the two statements to be true even if they seem to be at variance from commonly known facts. You have to decide which one of the given conclusions is definitely drawn from the given statements. Statement : All virtuous persons are happy. No unhappy person is virtuous. Conclusions : I. Happiness is related to virtue II. Unhappy person is not virtuous.....
QA->Which​ ​of​ ​the​ ​following​ ​statements​ ​is​ ​correct?....
QA->Which one of the following statements with regard to the "Make in India" initiative of the Government of India is not correct?....
QA->All of the following statements are correct except?....
QA->Name the translatory program which translates the high level language into machine language before running the program?....
MCQ->Which of the following statements are correct about the program? #include<stdio.h> char fun(unsigned int num, int base); int main() { char s; s=fun(128, 2); s=fun(128, 16); printf("%s\n",s); return 0; } char fun(unsigned int num, int base) { static char buff[33]; char ptr = &buff[sizeof(buff)-1]; ptr = '\0'; do { --ptr = "0123456789abcdef"[num %base]; num /=base; }while(num!=0); return ptr; }....
MCQ->What will be the output of the program ? #include<stdio.h> int main() { static int arr[] = {0, 1, 2, 3, 4}; int p[] = {arr, arr+1, arr+2, arr+3, arr+4}; int ptr=p; ptr++; printf("%d, %d, %d\n", ptr-p, ptr-arr, ptr); ptr++; printf("%d, %d, %d\n", ptr-p, ptr-arr, ptr); ++ptr; printf("%d, %d, %d\n", ptr-p, ptr-arr, ptr); ++ptr; printf("%d, %d, %d\n", ptr-p, ptr-arr, ptr); return 0; }....
MCQ->What will be the output of the program? #include<stdio.h> #include<stdarg.h> void fun1(int num, ...); void fun2(int num, ...); int main() { fun1(1, "Apple", "Boys", "Cats", "Dogs"); fun2(2, 12, 13, 14); return 0; } void fun1(int num, ...) { char str; va_list ptr; va_start(ptr, num); str = va_arg(ptr, char ); printf("%s ", str); } void fun2(int num, ...) { va_list ptr; va_start(ptr, num); num = va_arg(ptr, int); printf("%d", num); }....
MCQ->What will be the output of the program? #include<stdio.h> #include<stdarg.h> void fun1(char, int, int , float , char ); void fun2(char ch, ...); void (p1)(char, int, int , float , char ); void (p2)(char ch, ...); int main() { char ch='A'; int i=10; float f=3.14; char p="Hello"; p1=fun1; p2=fun2; (p1)(ch, i, &i, &f, p); (p2)(ch, i, &i, &f, p); return 0; } void fun1(char ch, int i, int pi, float pf, char p) { printf("%c %d %d %f %s \n", ch, i, pi, pf, p); } void fun2(char ch, ...) { int i, pi; float pf; char p; va_list list; printf("%c ", ch); va_start(list, ch); i = va_arg(list, int); printf("%d ", i); pi = va_arg(list, int); printf("%d ", pi); pf = va_arg(list, float); printf("%f ", pf); p = va_arg(list, char ); printf("%s", p); }....
MCQ->What will be the output of the program? #include int fun(int ptr); int main() { int i=10; const int ptr = &i; fun(&ptr); return 0; } int fun(int ptr) { int j = 223; int temp = &j; printf("Before changing ptr = %5x\n", ptr); const ptr = temp; printf("After changing ptr = %5x\n", ptr); return 0; }....
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