C Programming
Description: the objective questions are useful for GATE, MCA, Information technlogy | |
Number of Questions: 11 | |
Created by: Vijay Puri | |
Tags: Arrays Standard C Preprocessor File Handling Arrays and Pointers Data Types Variables and Storage Classes Looping Iteration Operators and Expression Functions Java/Oracle /C/C++ Structure, Unions and Enumerations Strings and Character Arrays |
What will be the output of the following program if 'n' key is pressed after execution of program? #include<stdio.h> #include<process.h> void main() {char ch; printf("enter Y/y to continue"); scanf("%c",&ch); if(ch=='y' || ch=='Y') printf("Yes"); else exit(1); }
Consider the letters written like A, B, C, V are the keys prssed by user. User can press any key, we have considered following keys has been prssed.
Which of the following functions have exactly same working? (a) putch() (b) putchar() (c) puts() (d) fputs() (e) fputchar()
Which of the following describes the function of strcmpi()?
Which of the following is not true about while and do while loop? (a) while loop is entry control and do-while is exit control. (b) do-while must be executed atleast once and while loop may execute once or not. (c) ‘;’ is given after while in both while and do-while loop. (d) Condition is given in while statement in both while and do-while loop.
Which of the following case constants in switch-case is/are not allowed? (a) case ‘S’: and case ‘s’: (b) case a + b: and case a + 3: (c) case i <= 20: (d) case 7 - 3: (e) case 3.14:
What will be the output of following program code? #include<stdio.h> main() { int k; float j; j=9.0/2; k=9/2.0; printf(%dt%ft,k,j); j=9/2; k=9/2; printf(%dt%ft,k,j); k=9.0/2.0; j=2/9.0; printf(%dt%ft,k,j); }
What does the following program code do? #include<stdio.h> void main() {FILE *f;char ch; int noi=0; f=open(“d.txt”,”r”); while(1) { ch=fgetc(f); if(f==EOF) break; if(ch==’ ‘) noi++’;} fclose(f); printf(“No. of …….=%d”,noi);}
Which of the following is not true about loops in ‘C’?
Which of the following structure declarations and structure variable's syntax is correct?
Which is the correct format for type casting in C? (Consider the following program code.) include<stdio.h> main() {int x=100,y=7; float z;z=……..; prinf(“z=%f”,z);}
What will be the output of following program code? #include<stdio.h> main() {int a=10,b=12,c=0; if(!(a>5&&c)) { printf(%d,a!=6&&b>5); printf(%d,a==10||b<15&&c<1); } else printf(If expression is wrong);}