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

23851. Point out the error in the program? #include<stdio.h> int main() { struct bits { float f:2; }bit; printf("%d\n", sizeof(bit)); return 0; }





23852. Point out the error in the program? #include<stdio.h> int main() { struct emp { char name[25]; int age; float bs; }; struct emp e; e.name = "Suresh"; e.age = 25; printf("%s %d\n", e.name, e.age); return 0; }





23853. Which of the following statements correct about the below program? #include<stdio.h> int main() { struct emp { char name[25]; int age; float sal; }; struct emp e[2]; int i=0; for(i=0; i<2; i++) scanf("%s %d %f", e[i].name, &e[i].age, &e[i].sal); for(i=0; i<2; i++) scanf("%s %d %f", e[i].name, e[i].age, e[i].sal); return 0; }





23854. Which of the following statements correct about the below program? #include<stdio.h> int main() { union a { int i; char ch[2]; }; union a u1 = {512}; union a u2 = {0, 2}; return 0; } 1: u2 CANNOT be initialized as shown. 2: u1 can be initialized as shown. 3: To initialize char ch[] of u2 '.' operator should be used. 4: The code causes an error 'Declaration syntax error'





23855. Which of the following statements correctly assigns 12 to month using pointer variable pdt? #include<stdio.h> struct date { int day; int month; int year; }; int main() { struct date d; struct date pdt; pdt = &d; return 0; }





23856. Which of the following statements correct about the below code? maruti.engine.bolts=25;





23857. A union cannot be nested in a structure



23858. Nested unions are allowed



23859. Bit fields CANNOT be used in union.



23860. one of elements of a structure can be a pointer to the same structure.



23861. A structure can be nested inside another structure.



23862. Which of the following statement is True?





23863. The '.' operator can be used access structure elements using a structure variable.



23864. Union elements can be of different sizes.



23865. A structure can contain similar or dissimilar elements



23866. The '->' operator can be used to access structures elements using a pointer to a structure variable only



23867. It is not possible to create an array of pointer to structures.



23868. If the following structure is written to a file using fwrite(), can fread() read it back successfully? struct emp { char n; int age; }; struct emp e={"IndiaBIX", 15}; FILE fp; fwrite(&e, sizeof(e), 1, fp);



23869. size of union is size of the longest element in the union



23870. The elements of union are always accessed using & operator



23871. Will the following code work? #include<stdio.h> #include<malloc.h> struct emp { int len; char name[1]; }; int main() { char newname[] = "Rahul"; struct emp p = (struct emp ) malloc(sizeof(struct emp) -1 + strlen(newname)+1); p->len = strlen(newname); strcpy(p -> name, newname); printf("%d %s\n", p->len, p->name); return 0; }



23872. A pointer union CANNOT be created



23873. Is there easy way to print enumeration values symbolically?



23874. By default structure variable will be of auto storage class



23875. Is it necessary that the size of all elements in a union should be same?



23876. Can we have an array of bit fields?



23877. Will the following declaration work? typedef struct s { int a; float b; }s;



23878. Can a structure can point to itself?



23879. If a char is 1 byte wide, an integer is 2 bytes wide and a long integer is 4 bytes wide then will the following structure always occupy 7 bytes? struct ex { char ch; int i; long int a; };



23880. How will you free the allocated memory ?





23881. What is the similarity between a structure, union and enumeration?





23882. The adjective of obey is





23883. HAPHAZARD means





23884. What will be the output of the program? #include<stdio.h> int main() { enum color{red, green, blue}; typedef enum color mycolor; mycolor m = red; printf("%d", m); return 0; }





23885. What will be the output of the program? #include<stdio.h> int main() { typedef int arr[5]; arr iarr = {1, 2, 3, 4, 5}; int i; for(i=0; i<4; i++) printf("%d,", iarr[i]); return 0; }





23886. What will be the output of the program? #include<stdio.h> int main() { typedef int LONG; LONG a=4; LONG b=68; float c=0; c=b; b+=a; printf("%d,", b); printf("%f\n", c); return 0; }





23887. What will be the output of the program? #include<stdio.h> int main() { typedef float f; static f fptr; float fval = 90; fptr = &fval; printf("%f\n", fptr); return 0; }





23888. What will be the output of the program? #include<stdio.h> typedef struct error {int warning, err, exception;} ERROR; int main() { ERROR e; e.err=1; printf("%d\n", e.err); return 0; }





23889. In the following code snippet can we declare a new typedef named ptr even though struct employee has not been completely declared while using typedef? typedef struct employee ptr; struct employee { char name[20]; int age; ptr next; }



23890. Point out the error in the following code? typedef struct { int data; NODEPTR link; }NODEPTR;





23891. Is the following declaration acceptable? typedef long no, ptrtono; no n; ptrtono p;



23892. Is there any difference in the #define and typedef in the following code? typedef char string_t; #define string_d char ; string_t s1, s2; string_d s3, s4;



23893. Are the properties of i, j and x, y in the following program same? typedef unsigned long int uli; uli i, j; unsigned long int x, y;



23894. typedef's have the advantage that they obey scope rules, that is they can be declared local to a function or a block whereas #define's always have a global effect.



23895. In the following code, the P2 is Integer Pointer or Integer? typedef int ptr; ptr p1, p2;





23896. In the following code what is 'P'? typedef char charp; const charp P;





23897. What is x in the following program? #include<stdio.h> int main() { typedef char ((arrfptr[3])())[10]; arrfptr x; return 0; }





23898. The compulsory Education Act will ensure education to the children upto the age of—





23899. The correctly spelt word is





23900. This beach is usually closed _____ a rainy day.





<<= 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