## Discussion Forum

Interative Forum for discussing any query literally to UGC-NET Computer Science, GATE Computer Science and Computer Sciene and Technology in general.

## UGC-NET Computer Science

Correspondence Courses and Test Series to prepare for UGC-NET computer science and applications

## GATE

MCQs, Lecture Notes, Ebooks for GATE preparation

## Jobs Newsfeed

Timely information of various Recruitments.

NextPrev

## MCQs C++ |UGC-NET|GATE|Computer Science

 11. Find the output for the following C programr main() { char *ptr = "Ramco Systems"; *ptr++; printf("%sn",ptr); ptr++; printf("%sn",ptr); } A. Ramco Systemsnamco Systemsn B. Ramco systems C. amco Systems D. Empty string View/Hide Ans Explanation 12. main() { int a,b,result; printf("nEnter the numbers to be multiplied :"); scanf("%d%d",&a,&b); result=0; while(b != 0) { if (b&01) result=result+a; a<<=1; b>>=1; } printf("nResult:%d",result); } For a=8 & b=6 what will be the output A. 68 B. 86 C. 48 D. 84 View/Hide Ans Explanation 13. Between a long pointer and a char pointer , which one consumes more memory? A. long pointer B. Char pointer C. Both will occupy same memory D. None of above View/Hide Ans Explanation 14. main() { int a[]={2,4,6,8,10}; int i; change(a,5); for(int i=0;i<=4;i++) printf("\n %d", a[i]); } change(int *b,int n) { int i; for(i=0;i A. 2,4 6,8 10 B. 7,9,11,13,15 C. 5,7,9,11,13 D. 3,5,7,9,11 View/Hide Ans Explanation 15. main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("n %d", i);} A. Some Integer not 100 B. 100 C. Runtime error. D. 0 View/Hide Ans Explanation 16. main() { int i, j, *p; i = 25; j = 100; p = &i; printf("%f", i/(*p) ); } A. Compile erro B. 1.00000 C. Runtime error. D. 0.00000 View/Hide Ans Explanation 17. main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } A. Compile error B. 0, 0 C. Runtime error. D. the first two values entered by the user. View/Hide Ans Explanation 18. struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); } A. Name B. compile error C. Your Name D. Runtime error View/Hide Ans Explanation 19. In the following code, in which order the functions would be called? x = f1(23,14)*f2(12/4)+f3(); A. f1, f2, f3 B. f3, f2, f1 C. The order may vary from compiler to compiler D. None of the above View/Hide Ans Explanation 20. What is the equivalent pointer expression for referring the same element a[i][j][k][l]? A. *(*(*(*(a+l)+k)+j)) B. *(*(*(*(a+i)+j)+k)+l) C. *(*(*(*(a+l)+k)+j)i) D. None of the above View/Hide Ans Explanation

Author Does Not claim of any answer these answers are as per expert opinion

Pages: 1 2 3 4 5 6 7 8 9