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

23801. What will be the output of the program ? #include<stdio.h> int main() { printf(5+"IndiaBIX\n"); return 0; }





23802. What will be the output of the program ? #include<stdio.h> #include<string.h> int main() { char sentence[80]; int i; printf("Enter a line of text\n"); gets(sentence); for(i=strlen(sentence)-1; i >=0; i--) putchar(sentence[i]); return 0; }





23803. What will be the output of the program ? #include<stdio.h> void swap(char , char ); int main() { char pstr[2] = {"Hello", "IndiaBIX"}; swap(pstr[0], pstr[1]); printf("%s\n%s", pstr[0], pstr[1]); return 0; } void swap(char t1, char t2) { char t; t=t1; t1=t2; t2=t; }





23804. What will be the output of the program (Turbo C in 16 bit platform DOS) ? #include<stdio.h> #include<string.h> int main() { char str1 = "India"; char str2 = "BIX"; char str3; str3 = strcat(str1, str2); printf("%s %s\n", str3, str1); return 0; }





23805. If the size of pointer is 4 bytes then What will be the output of the program ? #include<stdio.h> int main() { char str[] = {"Frogs", "Do", "Not", "Die", "They", "Croak!"}; printf("%d, %d", sizeof(str), strlen(str[0])); return 0; }





23806. What will be the output of the program ? #include<stdio.h> int main() { int i; char a[] = "\0"; if(printf("%s", a)) printf("The string is not empty\n"); else printf("The string is empty\n"); return 0; }





23807. What will be the output of the program ? #include<stdio.h> #include<string.h> int main() { char str1[5], str2[5]; int i; gets(str1); gets(str2); i = strcmp(str1, str2); printf("%d\n", i); return 0; }





23808. What will be the output of the program in Turbo C? #include<stdio.h> int main() { char str[10] = "India"; str[6] = "BIX"; printf("%s\n", str); return 0; }





23809. What will be the output of the program ? #include<stdio.h> int main() { char str1[] = "Hello"; char str2[] = "Hello"; if(str1 == str2) printf("Equal\n"); else printf("Unequal\n"); return 0; }





23810. What will be the output of the program ? #include<stdio.h> int main() { char t; char p1 = "India", p2; p2=p1; p1 = "BIX"; printf("%s %s\n", p1, p2); return 0; }





23811. What will be the output of the program ? #include<stdio.h> #include<string.h> int main() { printf("%c\n", "abcdefgh"[4]); return 0; }





23812. What will be the output of the following program in 16 bit platform assuming that 1022 is memory address of the string "Hello1" (in Turbo C under DOS) ? #include<stdio.h> int main() { printf("%u %s\n", &"Hello1", &"Hello2"); return 0; }






23813. Which of the following statements are correct about the program below? #include<stdio.h> int main() { char str[20], s; printf("Enter a string\n"); scanf("%s", str); s=str; while(s != '\0') { if(s >= 97 && s <= 122) s = s-32; s++; } printf("%s",str); return 0; }





23814. Which of the following statements are correct about the below declarations? char p = "Sanjay";char a[] = "Sanjay"; 1: There is no difference in the declarations and both serve the same purpose. 2: p is a non-const pointer pointing to a non-const string, whereas a is a const pointer pointing to a non-const pointer. 3: The pointer p can be modified to point to another string, whereas the individual characters within array a can be changed. 4: In both cases the '\0' will be added at the end of the string "Sanjay".





23815. Which of the following statements are correct ? 1: A string is a collection of characters terminated by '\0'. 2: The format specifier %s is used to print a string. 3: The length of the string can be obtained by strlen(). 4: The pointer CANNOT work on string.





23816. I --------------- nothing infront of me.





23817. Will the program compile successfully? #include<stdio.h> int main() { char a[] = "India"; char p = "BIX"; a = "BIX"; p = "India"; printf("%s %s\n", a, p); return 0; }



23818. For the following statements will arr[3] and ptr[3] fetch the same character? char arr[] = "IndiaBIX";char ptr = "IndiaBIX";



23819. Is there any difference between the two statements? char ch = "IndiaBIX";char ch[] = "IndiaBIX";



23820. Which of the following function sets first n characters of a string to a given character?





23821. If the two strings are identical, then strcmp() function returns





23822. How will you print \n on the screen?




23823. The library function used to find the last occurrence of a character in a string is





23824. Which of the following function is used to find the first occurrence of a given string in another string?





23825. Many times we see in newspapers that some projects are launched by the Govt. Authorities on ‘PPP’ basis. What is the full form of ‘PPP’ ?





23826. Which of the following countries is not the member of Asia Pacific Economic Cooperation (APEC) which was in news recently ?





23827. The opposite of ‘‘implicit’’ is:





23828. ‘Gas’ is to ‘gaseous’ as ‘water’ is to:





23829. The meaning of ‘Prodigal’ is





23830. What will be the output of the program ? #include<stdio.h> int main() { union a { int i; char ch[2]; }; union a u; u.ch[0]=3; u.ch[1]=2; printf("%d, %d, %d\n", u.ch[0], u.ch[1], u.i); return 0; }





23831. What will be the output of the program ? #include<stdio.h> int main() { union var { int a, b; }; union var v; v.a=10; v.b=20; printf("%d\n", v.a); return 0; }





23832. What will be the output of the program ? #include<stdio.h> int main() { struct value { int bit1:1; int bit3:4; int bit4:4; }bit={1, 2, 13}; printf("%d, %d, %d\n", bit.bit1, bit.bit3, bit.bit4); return 0; }





23833. What will be the output of the program in 16 bit platform (Turbo C under DOS) ? #include<stdio.h> int main() { struct value { int bit1:1; int bit3:4; int bit4:4; }bit; printf("%d\n", sizeof(bit)); return 0; }





23834. What will be the output of the program ? #include<stdio.h> int main() { enum days {MON=-1, TUE, WED=6, THU, FRI, SAT}; printf("%d, %d, %d, %d, %d, %d\n", MON, TUE, WED, THU, FRI, SAT); return 0; }





23835. What will be the output of the program ? #include<stdio.h> int main() { enum status {pass, fail, absent}; enum status stud1, stud2, stud3; stud1 = pass; stud2 = absent; stud3 = fail; printf("%d %d %d\n", stud1, stud2, stud3); return 0; }





23836. What will be the output of the program ? #include<stdio.h> int main() { int i=4, j=8; printf("%d, %d, %d\n", i|j&j|i, i|j&j|i, i^j); return 0; }





23837. What will be the output of the program in Turbo C (under DOS)? #include<stdio.h> int main() { struct emp { char n; int age; }; struct emp e1 = {"Dravid", 23}; struct emp e2 = e1; strupr(e2.n); printf("%s\n", e1.n); return 0; }





23838. What will be the output of the program in 16-bit platform (under DOS)? #include<stdio.h> int main() { struct node { int data; struct node link; }; struct node p, q; p = (struct node ) malloc(sizeof(struct node)); q = (struct node ) malloc(sizeof(struct node)); printf("%d, %d\n", sizeof(p), sizeof(q)); return 0; }





23839. What will be the output of the program ? #include<stdio.h> int main() { struct byte { int one:1; }; struct byte var = {1}; printf("%d\n", var.one); return 0; }





23840. What will be the output of the program ? #include<stdio.h> int main() { enum days {MON=-1, TUE, WED=6, THU, FRI, SAT}; printf("%d, %d, %d, %d, %d, %d\n", ++MON, TUE, WED, THU, FRI, SAT); return 0; }





23841. What will be the output of the program ? #include<stdio.h> struct course { int courseno; char coursename[25]; }; int main() { struct course c[] = { {102, "Java"}, {103, "PHP"}, {104, "DotNet"} }; printf("%d ", c[1].courseno); printf("%s\n", ((c+2)).coursename); return 0; }





23842. What will be the output of the program given below in 16-bit platform ? #include<stdio.h> int main() { enum value{VAL1=0, VAL2, VAL3, VAL4, VAL5} var; printf("%d\n", sizeof(var)); return 0; }





23843. Point out the error in the program? struct emp { int ecode; struct emp e; };





23844. Point out the error in the program? typedef struct data mystruct; struct data { int x; mystruct b; };





23845. Point out the error in the program? #include<stdio.h> int main() { struct a { float category:5; char scheme:4; }; printf("size=%d", sizeof(struct a)); return 0; }





23846. Point out the error in the program? #include<stdio.h> int main() { struct emp { char name[20]; float sal; }; struct emp e[10]; int i; for(i=0; i<=9; i++) scanf("%s %f", e[i].name, &e[i].sal); return 0; }





23847. Point out the error in the program? #include<stdio.h> #include<string.h> void modify(struct emp); struct emp { char name[20]; int age; }; int main() { struct emp e = {"Sanjay", 35}; modify(&e); printf("%s %d", e.name, e.age); return 0; } void modify(struct emp p) { p ->age=p->age+2; }





23848. Point out the error in the program in 16-bit platform? #include<stdio.h> int main() { struct bits { int i:40; }bit; printf("%d\n", sizeof(bit)); return 0; }





23849. Point out the error in the program? #include<stdio.h> int main() { union a { int i; char ch[2]; }; union a z1 = {512}; union a z2 = {0, 2}; return 0; }





23850. Point out the error in the program? #include<stdio.h> int main() { struct emp { char n[20]; int age; }; struct emp e1 = {"Dravid", 23}; struct emp e2 = e1; if(e1 == e2) printf("The structure are equal"); return 0; }




<<= 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
DMCA.com Protection Status Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions