Fundamentals of



Download 9.46 Mb.
Page21/57
Date09.01.2017
Size9.46 Mb.
#8172
1   ...   17   18   19   20   21   22   23   24   ...   57

Q.77 The memory space required to store the string =ND= is bytes

(a)5 (b)6 (c)0 (d)infinity
Q.78 Which of the following is a correct method of declaration for a string of 100 characters


(a)char a[100];

(b)char a[99];

(b) char a[101]; (d)none of the above





Q.79 To accept a string from user, which of the following is used

(a)getchar() (b) putchar() (b)gets() (d) puts
Q 80 string accepted from user is automatically terminated with null character (“\0”)

(a)True (b)False
Q.81 The header file that has various string functions like strcpy(),strcat(),ect is

(a)string (b)float (c)int (d)void


Q.82The strcpy() function will return a_ _datatype value

(a)string (b)float (c)int (d)void
Q.83 The strlen() function will return for the string with the value=ND=

(a)4 (b)5 (c)6 (d)none of the above


Q.84 The initial of an automatic storage class variable is

(a)zero(0) (b)garbage (c)1 (d)none of the above


Q.85 The automatic storage class variable is stored in

(a)memory (b)CPU registers (c)nowhere (d)compile


Q.86 The scope of a variable declared as automatic storage class is

(a)local within the function declared



(b)global

(c)in multiple programs

(d)none of the above




Q.87 The life of a variable as automatic storage class is

(a)until the program completes its execution

(b)till the control remain in the function where it is declared

(c)until the computer remains on

(d)none of the above
Q.88 The initial value of an integer storage class variable is

(a)zero(0) (b)garbage (c)1 (d)none of the above


Q.89 The register storage class variable is stored in

(a)memory (b)CPU registers (c)nowhere (d)compiler
Q.90 The scope of a variable declared as register storage class is


(a)local within the function declared

(c)in multiple programs

(b)global



(d)none of the above



Q.91 The life of a variable declared as register storage class is

(a)until the program completes its execution



(b)till the control remains in the function where it is declared

(c)until the computer remain on

(d)none of the above



Q.92 The maximum number of register storage class variables can be

(a)1 (b)2 (c)3


(d)None of the above



Q.93 The initial value of an static storage class variables is

(a)zero(0) (b)garbage (c)1 (d)none of the above
Q.94 The static storage class variable is stored in

(a)memory (b)CPU registers (c)nowhere (d)compile
Q.95 The scope of a variable declared as static storage class is_


(a)local within the function declared

(c)in multiple programs

(b)global



(d)none of the above



Q.96 The life of a variable declared as static storage class is

(a)until the program completes its execution



(b)till the control remains in the function where it is declared

(c)until the computer remains on

(d)none of the above



Q.97 The initial value of an externally declared variable is

(a)zero(0) (b)garbage (c)1


(d)none of the above



Q.98 The externally declared variable is stored in

(a)memory (b)CPU registers (c)nowhere (d)compile
Q.99 The scope of a variable declared externally, is

(a)local within the function declared (b)global




(c)in multiple programs (d)none of the above


Q.100 The life of a variable declared externally,is

(a)until the program completes its execution



(b)till the control remains in the function where it is declared

(c)until the computer remains on

(d)none of the above
Q.101 Find the output of the following program

#include



int x;

void f1()

{

++x;



}

void main()

{


int x=10; f1(); x=::x+10;

printf(%d%d\n x x)

}

(a): 11 1



(c) 1 1 1

(b)1 1


(d)None of the above



Q.102 Find the output of the following program

#include<stdio.h>

void f1()

{

extern int n3; static int n1; int n2=20; n1=n1+10; n2=n1+n2; n3=n1+n2;



printf(%d%d%d\n n1 n2 n3)

}

int n3;



void main()

{

register int I;



for(i=1;i<=3;i++)f1();

}

(a)10 10 10



20 20 20

30 30 30

(b)10 30 40

10 30 40

10 30 40



(c)10 30 40



20 40 60

30 50 80

(d)None of the above


ANSWER KEY



Que No

Ans

Que No

Ans

Que No

Ans

Que No

Ans

1

A

31

A

61

B

91

B

2

D

32

A

62

B

92

C

3

A

33

C

63

A

93

A

4

C

34

B

64

A

94

A

5

A

35

C

65

C

95

A

6

B

36

A

66

B

96

A

7

B

37

B

67

A

97

A

8

D

38

C

68

C

98

A

9

C

39

C

69

B

99

C

10

A

40

C

70

D

100

A

11

A

41

C

71

D

101

A

12

D

42

A

72

C

102

C

13

C

43

B

73

D







14

A

44

A

74

C







15

A

45

A

75

B







16

B

46

A

76

C







17

A

47

B

77

B







18

B

48

A

78

A







19

B

49

B

79

C







20

C

50

A

80

A







21

A

51

A

81

C







22

B

52

B

82

C







23

A

53

A

83

B







24

A

54

B

84

B







25

A

55

B

85

A







26

B

56

D

86

A







27

A

57

B

87

B







28

C

58

B

88

B







29

D

59

A

89

B







30

A

60

B

90

A








Download 9.46 Mb.

Share with your friends:
1   ...   17   18   19   20   21   22   23   24   ...   57




The database is protected by copyright ©ininet.org 2024
send message

    Main page