Model question paper_mc0061


Published on


Published in: Education
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Model question paper_mc0061

  1. 1. 1 | P a g eSikkim Manipal UniversityModel Question PaperSubject: Computer Programming ‘C Language’ Subject code: MC 0061Total Time: 2 hours Total Marks: 140Notes:1. Question paper is divided into three parts i.e. Part A, Part B, and Part C.2. Part A consist 40 questions of 1 mark each3. Part B consist 20 questions of 2 marks each.4. Part C consist 15 questions of 4 marks each.5. All questions are compulsoryPart A (One Mark Question)1) C Program must have –a. Start () functionb. Begin() functionc. Main() functiond. First() function2) int a[]={5,4,3,2,1} What is the value of a[3]?a. 2b. 3c. 4d. 13) float a[10]; What is the size of the array?a. 10b. 20c. 30d. 404) In C a variable name cannot containa. Blank Spaceb. Underscorec. Letterd. Digits5) Array is :a. Primary data typeb. Homogeneous data typec. Pointer data type
  2. 2. 2 | P a g ed. Heterogeneous data type6) Array index can be started from 1?a. Yesb. No7) To accept 100 different values into the array we require:a. Loopb. If conditionc. Functiond. Structure8) Which of the following is odd one outa. +b. –c. /d. **9) Pointer holdsa. Value of variableb. Address of variablec. Value and address of variabled. Always null10) An integer constant in C must havea. At least one digitb. At least one decimal pointc. A comma along with digitsd. Digits separated by commas11) Backslash character constanta. Started with single coteb. Started with backslashc. Started with nd. Non of the above12) How many operators are there in C Languagea. 8b. 9c. 10d. 713) How many bits are required to represent double data type in memorya. 32
  3. 3. 3 | P a g eb. 16c. 10d. 814) What will be the output of the expression: Printf(“%d”, „1‟);a. 1b. 48c. 49d. 015) The function getchar() is used to accepta. One character value at a timeb. Two character value at a timec. Ten character value at a timed. Many character value at a time16) A structure brings together a group ofa. items of the same data typeb. related data items and variablesc. integers with user defined namesd. floating points with user defined names17) EOF is aa. Macrob. Functionc. Variabled. Constant18) scanf() can able to accepta. Only character types of valuesb. Any types of valuesc. Only numeric types of valuesd. Only string types of values19) If statement is aa. Conditional Statementb. Assignment Statementc. Looping Statementd. Arithmetic Statement20) goto statement is only essential becausea. to exit from current loopb. to exit from program
  4. 4. 4 | P a g ec. to exit from more than one loopsd. to exit from file21) In switch statement break is used :a. to break from loopb. to break from casec. to break from default case onlyd. all of the above22) do -while is the loop wherea. condition checks at end of the loopb. condition checks at beginning of the loopc. condition checks within the loop bodyd. condition never checks23) while is the loop wherea. condition checks at end of the loopb. condition checks at beginning of the loopc. condition checks within the loop bodyd. condition never checks24) for(;;)a. it is a finite loopb. it is a infinite loopc. the control never enter into the loop bodyd. None of the above25) Function prototype declaration isa. optional for good programb. compulsory for good programc. frequently required for good programd. never required for good program26) In function call by valuea. transfers value onlyb. transfers both value and addressc. transfers either value or addressd. transfers none of the above27) By default function returns isa. floatb. integerc. double
  5. 5. 5 | P a g ed. void28) Built –in function can be used in a programa. only one timeb. only two timesc. number of timesd. only through user defined function29) In the recursive functiona. We are telling “what to do?”b. We are telling “How to do?”c. We are telling “Not to do.”d. We are telling “Why to do?”30) Visibility of a variable meansa. How much the capacity of the variable?b. How much the rest of the program can access the variable?c. How many times the variable is used?d. How many times the value is changed?31) The auto storage classa. keeps value within the blockb. destroys value within the blockc. copies value to global variabled. transfer value to the other function32) If we include header files in the program , thena. It compiles more number of linesb. It compiles same number of linesc. It complies less number of linesd. None of the above.33) In language C ,variable number of signature isa. not possibleb. possiblec. possible for some special functiond. Possible for main function only34) In language C , Array index starts witha. -1b. 0c. 1d. 2
  6. 6. 6 | P a g e35) For integer array, max number that can store into one cella. 32,768b. 65,535c. 100000d. 136) For character array, how many character(s) can store in a single cella. One Characterb. Two Charactersc. More than Ten Charactersd. More than Hundred Characters37) In case of pointer operation & is calleda. Value ofb. Address ofc. Data ofd. None of the above38) Structure is aa. Fundamental Data Typeb. User defined Data Typec. Homogeneous Data Typed. None of the above39) To create structure we use the key worda. strb. strucc. structd. structure40) Dynamic memory allocation meansa. we can allocate disk memory at any timeb. We can allocate main memory at any point of timec. We can reallocate static memory at any timed. None of the above
  7. 7. 7 | P a g ePart B (Two Mark Question)41) What will be the value of d (assume d to be a float) after the operation d=2/7.0?a. 0b. 0.2857140c. 0.3343334d. 1.001023242) The expression, a=30*1000+2893 ; evaluates toa. 32768b. – 32643c. 113983d. 043) If a in an integer variable, a=5/2; will return a valuea. 2.5b. 3c. 2d. 044) The expression x= 4+2%-8a. 6b. -6c. 0d. 845) To increment the value of i by 2 only, we can‟t user the expressiona. i+=2;b. i+++;c. i=i+2;d. a=i+2; i=a;46) What will be the value of i after execution of the expression: int i=2; i+=i++ + ++i;a. 10b. 12c. 16d. 1447) Which of the following statement is wrong
  8. 8. 8 | P a g ea. x+5=y;b. x=x+5;c. x=y;d. x=5;48) What is the value of the expression: A=(int)3.9 /(int)2.3a. 2b. 1c. 3d. 049) What will be the value of the expression: x=‟1‟+‟2‟+‟3‟; x/=3; printf(“%c”,x);a. 2b. 3c. 4d. 150) What will be the output of the expression: int a=2345; printf(“a=%2d”,a);a. 2345b. 23c. 45d. 051) What will be the output : int a, x=10,y=20; a=!(x>y)?x:ya. 20b. 10c. 0d. 152) What will be the output of the following expressionvoid main(){int a=1;if(a=8)printf(“Good”);else if(a=1)printf(“Fair”);else
  9. 9. 9 | P a g eprintf(“Bad”);}a. Goodb. Fairc. Badd. None of the above53) How many times the loop will execute?for (i=100;i<=200;i++){ i--;}a. 100 timesb. 200 timesc. 101 timesd. infinite number of times54) What will be the outputvoid main(){int x=5for(;x<=10;x++)printf(“%5d”,x+1);}a. 5 6 7 8 9 10b. 6 7 8 9 10 11c. 5 7 9 11 13 15d. 6 7 8 9 10 1355) What will be the output :void main(){void function(void);function(); function(); function();
  10. 10. 10 | P a g e}void function(void){ static int i=1;printf(“%5d”,i++);}a. 3 3 3b. 1 2 3c. 1 1 1d. 2 2 256) What will be the outputvoid main (){char name[]=”Arindam”;int i;static int x=0;while(name[x]!=‟0‟){for(i=0;i<=x;i++)printf(“%c”,name[i];)printf(“n”);x=i; i=0;}}a. “Arindam” in Triangular Patternb. “Arindam” in Horizontal Linear Patternc. “Arindam” in Vertical Linear Patternd. None of the above57) What will be the output of the program?
  11. 11. 11 | P a g evoid main(){int a[5]={1,2,3,4,5},*pt;pt=a;pt++;printf(“%d”,++*pt);}a. 2b. 3c. 4d. 158) With a single FILE pointer how many file(s) can be opened at a time?a. 1 Filesb. 2 Filesc. 3 Filesd. Many Files59) Find the output#define S(X) X*X#define S(X) (X*X)If X=4 then the value of S(X) will be ?a. 16 16b. 16 4c. 4 16d. 4 460) The expression (a+b)/3 is ina. Infix Notationb. Prefix Notationc. Postfix Notationd. Polish Notation
  12. 12. 12 | P a g ePart C (Four Mark Question)61) What will the value of rootdouble a=2,b=2,c=2,dis=10;dis=b*b-4*c;root=-b-sqrt(dis)/(2*a);a. 10b. 0c. Syntax errord. Domain error62) Determine the value of the logical expressions if a=5 ,b=10 and c= -6(a/2.0==0.0 && b/2.0!=0.0)||c<0.0a. 0b. 1c. 2d. 363) What is the output of the following program?Void main(){int m;for(m=1;m<5;m++);printf(“%dn”,(m%2)?m:m*2);}a. 5b. 10c. 0d. 164) How many times the loop will executeint a=10;While(i<=10){ printf(“%d”,i++); i--; }a. One timesb. Two times
  13. 13. 13 | P a g ec. Infinite number of timesd. Never enter into the loop65) Pick up the correct answerWhile(…){While(…){while(…){Break;}}}a. It will break from current loopb. It will break from second loopc. It will break from all the loopsd. It will break from program66) What is the value of x;int a,*p;a=10; p=&a;x=*(&(*p))a. 10b. 20c. Address of ad. Address of p67) What is the value of xint a[]={5,6,7,8,0},*p;p=a;int x=*p++;a. 5b. 6c. 7d. 868) What is the value of X
  14. 14. 14 | P a g eUnion{Struct student{ int roll; }Struct{ float salary;}}people;X= sizeof(people);a. 2b. 3c. 4d. 069) Pick the correct answerFILE *pt;pt=fopen(“Filename”,”r”);function returns pt=NULL;a. The function cannot find the fileb. The function found the file but unable to writec. The function found the file but unable to appendd. The function able to open the file70) What is the value of A#define N 10#define N1 (R) (N*2+R)A=N1(4)a. It is correct and returns 20b. It is not correct and returns errorc. It is correct and returns 24d. It is correct and returns 25----