Вы находитесь на странице: 1из 6

GURU GOBIND SINGH COLLEGE FOR MTMS

AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Data Structure using C

Q1. Which statements are true?


(a) #include<stdio.h> (b) #include “stdio.h”
(c) both (a) and (b) (d) None the above

Q2. “C” processor directives are used for-


(a) including files (b) substitution of values
(c) conditional compilations (d) all the above

Q3, & (ampersand) is act as


(a) pointer operator (b) increment operator
(c) assignment operator (d) decrement operator

Q4. Which statement is used to take the control of the program to the beginning of the loop?
(a) Break (b) continue (c) while (d) switch

Q5. Which is the category of function?


(a) no arguments & no return value (b) no arguments but return value
(c) arguments but no return value (d) all the above

Q6. The function technique, when a function call by itself is called


(a) call by reference (b) global function
(c) recursive function (d) local function

Q7. String can be defined as


(a) sequence of characters (b) group of characters
(c) none the above (d) both (a) and (b)

Q8. All static variables are automatically initialized to


(a) 1 (b) 0 (c) –1 (d) Null

Q9. Global variable are also called


(a) static variable (b) external variable
(c) register variable (d) automatic variable

Q10. Which loop executes statements at once even if the condition is fails for the first time?
(a) for loop (b) while loop (c) do while loop (d) all the above

Q11. Which is not unformatted function?


(a) scanf() (b) getch() (c) getche() (d) getchar()

Q12. Which function receives a string from keyboard?


(a) gets() (b) getch() (c) printf() (d) getchar()

Q13. Conditional multiple branching statement is


(a) if-else (b) switch-case (c) break (d) continue

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q14. Which is not the advantage of array?


(a) it saves the memory space (b) data items searching is slower
(c) huge quantity of data items can be stored under single variable name
(d) data items searching is faster

Q15. Array can be classified into following types


(a) single dimensional array (b) multi dimensional array
(c) double dimensional array (d) all the above

Q16. Which statement is true for array definition?


(a) <data type> <array name> [array range] (b) <array name> <data type> [array range]
(c) <array name> [array range] <data type> (d) <data type> [array range] <array name>

Q17. Double dimensional array is also called


(a) two dimensional array (b) matrix (c) subscript (d) none the above

Q18. Which statement is not true for function?


(a) The number of arguments should be equal to the number of parameters used
(b) The same variable can be used as arguments and parameters.
(c) They should not be in same order
(d) They should have the same data type

Q19. A variable declared inside a function without storage class specification is, by default
(a) static (b) register (c) automatic (d) external

Q20. What is the output of the following program:-


#include<stdio.h>
main()
{
char st[]= “computer”;
int i=0;
while(st[i]!=’\0’)
{
printf(“%c”,st[i]);
i++;
}
printf(“Length of string=%d”,i);
}
(a) computer, 8 (b) computer, 9 (c) computer,10 (d) no result

Q21. Find the output of following program


main()
{
int i,j;
for (i=1;i<=3;i++);
{
for (j=1;j<=5;j++);
printf(“*”);
printf(“\n”)
}

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

}
(a) *****
*****
*****

(b) ***
***
***
***
***

(c) Error or no output

(d) *
**
***
****
*****

Q22. What is the output of following program


main()
{
int a,b,sum;
a=10;
b=10;
sum=sumx(a,b);
printf(“Result one is %d”,sum);
}
int sumx(int x,int y)
{
a=a+10;
b=b+10;
printf(“Result two is %d”,sum);
return (a+b);
}
(a) 20 (one), 40(two) (b) 40 (one), 20 (two)
(a) Error (d) 20 (one), 20 (two)

Q23. The subscript of array must be start from


(a) 1 (b) 0 (c) –1 (d) none the above

Q24. Which is the control structure:-


(a) conditional (b) branching (c) looping (d) all the above

Q25. Which function compares two strings


(a) strncmp() (b) strcmp() (c) strcmpi() (d) strnicmp()

Q26. Which is the string copy function:-


(a) strcpy() (b) strncpy() (c) both (a) and (b) (d) none

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q27. Which is the technique of parameter passing:-


(a) call by value (b) call by reference
(c) both (a) and (b) (d) none the above

Q28. In which method the original value gets change within the calling function:-
(a) call by value (b) call by reference
(c) both (a) and (b) (d) none the above

Q29. Function can be classified into following categories:-


(a) Built-in function and user-defined function
(b) Standard function and user-defined function
(c) none the above
(d) Both (a) and (b)

Q30.Which syntax is true for two dimensional arrays:-


(a) <type> <subscript name>[row][column]
(b) <type> <subscript name>[column][row]
(c) <type> <subscript name>[row][column];
(d) <subscript name><type> [row][column]

Q31.What is first statement of every C program is-


(a) main function (b) preprocessor directive
(c) file name (d) none the above

Q.32. #Include is used for


(a) to define a Macro (b) to include the content of file
(c) to include undefined Macro (d) None

Q.33. to display integer value in C, we use


(a) %f (b) %d (c) %c (d) %s

Q.34. for statement


printf("%6d" 5555), output will be
(a)
5 5 5 5

(b)
5 5 5 5

(c)
5 5 5 5
(d) None

Q.35. Which of these is a advantage of Array


(a) data items stored under single variable name
(b) array saves the memory space
(c) arrange the data in particular order
(d) all of above

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q.36. classification of function as


(a) Built In (b) User defined function
(c) standard function (d) All of above

Q.37. External variables are


(a) Global (b) local (c) Static (d) None

Q.38. Fastest storage class is


(a) External storage class (b) Static storage class
(c) Automatic Storage class (d) Register variable

Q.39. output for a code:


#include <stdio.h>
main()
{
char st[] = "shakti";
printf ("String %C", st);
}
(a) shakti (b) s h a k t i (c) s (d) None

Q.40. strcat is used to


(a) find the length of string (b) concat two string
(c) compare two strings (d) No

Q41. The fixed looping control is:-


(a) while loop (b) do while loop
(b) for loop (d) all the above

Q42. Which function will not echo the key character:-


(a) getchar() (b) getche() (c) getch() (d) fgetchar()

Q43. printf (“%6d”, 5555); what will the output:-


(a) _ _ 5555 (b) 5555_ _ (c) 55_55 (d) error

Q44. All C statements are entered in:-


(a) upper case letters (b) small case letters
(c) both (a) and (b) (d) none the above

Q45. Preprocessor directives are statements executed:-


(a) after the source program is complied
(b) before the source program is complied
(c) mid the source program is complied
(d) none the above

Q46. Which is defined the order of execution of specified statements in a program:-


(a) control structure (b) variables (c) array (d) all the above

Ph. 9810455330, 25138338, 25138339


GURU GOBIND SINGH COLLEGE FOR MTMS
AL – 7 Main Jail Road, Hari Nagar, New Delhi – 110064

Q47.
50 49 89
78 67 45
56 40 54

What is the cell value, position 2, 1:-


(a) 50 (b) 45 (c) 56 (d) 67

Q48. What is the output of following program:-


main ()
{
int a;
a=0;
while (a<10)
printf(“%d”,a);
}
(a) 9 (b) 10 (c) 10 (d) error (e) 0

Q49. Which is not a string function:-


(a) strrev() (b) scanf() (c) getch() (d) gets()

Q50. To undefine a macro:-


(a) #undefine
(b) #undef
(c) #endef
(d) #indef

Ph. 9810455330, 25138338, 25138339

Вам также может понравиться