C--PROGRAM ALL QUESTIONS ANSWER



 C--PROGRAM ALL QUESTIONS 

Question 1

Which one is a High Level Language

a) Assembly Language

b) Machine Language

c) Parser

d) C

Question 2

A programming language that provides little or no abstraction from a computer's

instruction set architecture

a) Low Level Language

b) High-Level Language

c) Interpreter

d) Browser

Question 3

In which year C language was developed ?

a) 1974

b) 1972

c) 1971

d) 1973

Question 4

Name of a memory location that we use for storing data whose values can be changed

a) Variables

b) static

c) constant

d) pointer

Question 5

Which of the following is not a type of computer programming language?

a) Natural Language

b) Machine Language

c) High-level Languages

d) Binary Languages

Question 6

The programming language that closely resembles the machine language is

a) High-level languages

b) C Language

c) FORTRAN

d) Assembly Language

Question 7

The tool used to convert a "C" program to machine language is called as

a) Linker

b) Language translator

c) Compiler

d) Preprocessor

Question 8

The programmer original program code is called as

a) Object file

b) Source file

c) Executable file

d) Application file

Question 9

The diagrammatic flow of the program is represented by

a) Flowchart

b) Program map

c) Pseudo code

d) Water fall mode 

Question 10

C- language is

a) Assembly level Language

b) Low level Language 

c) High level Language

d) All of above

Question 11

What is a program a) A set of instruction

b) A set of algorithem

c) A set of pseudo code

d) All of above

Question 12

Who developed the C language

a) Dennis Ritchie

b) Ken Thompson

c) Matrin Richards

d) Patric Naughton

Question 13

The C language has been developed at

a) AT & T Bell Labs

b) IBM

c) Borland International

d) Sun Microsystems

Question 14

Every statement in C program is to be terminated by a

a) dot(.)

b) semi-colon(;)

c) colon(:)

d) question mark(?)

Question 15

The escape sequence \b" is a

a) back space

b) next line

c) tab

d) none of the above

Question 16

Which OS (Operating System) supports C?

a) DOS only

b) Linux only c) Window only

d) All of the above

Question 17

A character variable can store how many characters at a time?

a) 1 character

b) 8 character

c) 255 character

d) None

Question 18

What will be stored in the variable "ch" if we write the statement char ch='z'?

a) ASCII value of Z

b) Z along with the single inverted commas

c) The character Z

d) None of above

Question 19

What is the maximum value that an signed integer constant can have?

a) 32768

b) 32767

c) 1.7014E+38

d) 256

Question 20

A variable name in C cannot start with?

a) a number

b) an alphabet

c) a capital charecter

d) None of above

Question 21

Which of the following statements is wrong?

a) int=123;

b) value=''+5

c) lime=20*'T' 

d) count+5 result

Question 22

Which of the following statement is incorrect?

a) rem=3%2;

b) rem-3.14%2.1;

c) rem='a' % 'c'

d) None of above

Question 23

Which of the following special symbol allowed in an identifier?

a) *(asteric)

b) (underscore)

c) '-(hyphen)

d) (pipeline)

Question 24

Which will be the output of following program?

#include<stdio.h>

void main()

{

int i=20;

printf("%d\n", sizeof(i));

a) 2

b) 4

c) 20

d) None of above

Question 25

Which will be the output of following program?

#include<stdio.h>

void main()

{

int a;

printf("%d\n", a);

}

a) Error

b) 0

c) -1

d) Garbage Value

Question 26

Which will be the output of following program include <stdib.h>?

#include<stdio.h>

void main()

{int x = 10, y = 20, z = 5, i;

i = x<y,z;

printf("%d\n", i);

a) 0

b) 1

c) Error

d) None of Above

Question 27

Which of the following variable declaration is correct?

a) int length

b) char int

c) int long 

d) All

Question 28

Which statement is correct for the comment used in C programming?

a) Comments are used to have some explanations in the programmers source code

b) only if a line begin with double slash, it is a comment

c) Comment decide the sequence of operations in the program

d) Comments must be outside the curly braces

Question 29

The preprocessor directive in? C? programming language begins with a) Hashsign(#)

b) Backslash and asterisk(/*)

c) Less than symbol

d) Two back shash(//)

Question 30

Every C program should compulsorily have a function called as:

a) start()

b) Start() 

c) main()

d) Main()

Question 31

A block comments begins and ends with?

a) Start with / and end with //

b) Start with /* and end with */

c) Start with // and end with //

d) Start with < and end with >

Question 32

Which of the following cannot be used in identifiers?

a) Letters

b) Spaces

c) Underscore

d) Digits

Question 33

The difference between a and "a" is

a) The first one refers to a variable whose identifier is a and the second one refers to the character constant a

b) The first one is a character constant a and second one is the string literal a

c) Both are same

d) None of above

Question 34

Which of the following is not a valid escape code?

a) \t

b) lw

c) 11

d) \n

Question 35

const int width=100;

Regarding the above statement which of the statements is true?

a) Declares a variable width initialized as 100

b) Declares a construction with initialized as 100

c) Declares a integer type constant width with a fixed value of 100

d) Constructs an integer type variable with width a value 100

Question 36

For an assignment statement

a) The left side value of the assignment operator must always be a variable

b) The right side value of the assignment operator might be a constant, a variable, an expression or any combination of these

c) The assignment always takes place from right to left and never the other way d) All of above

Question 37

For the assignment statement :a=b;

Which of the following statement is true?

a) A check is done to compare the values of a and b

b) The value of b is assigned to variable a and any further changes in the program on variable b will also change the value of variable a

c) The value of b is assigned to variable a and any further changes in the program on variable b will not change the value of variable a

d) The value of b is assigned to variable b and any further changes in the program on variable a will not change the value of variable b

Question 38

Which of the following will not valid expressions in C?

a) a=2+(b=5);

b) a=b=c=5;

c) a=11%3

d) b+5=2

Question 39

Which of the following will not increase the value of variable c by 1?

a) c++;

b) c=c+1; 

C) C+1>=c 

d) c+=1

Question 40

When following code is executed, what will be the values of a and b? 

b=3;

a=b++;

printf("\nb=%d",a);

printf("\na=%d",b);

a) a contains 3 and b contains 4 

b) a contains 4 and b contains 4

c) a contains 4 and b contains 3

d) a contains 3 and b contains 3

Question 41

The result of relationai operator is always

a) either true or false

b) either less than or more than

c) either equal, less or more

d) None of above

Question 42

Which of the following is not a valid relational operator?

a)'==

b)'=>

c)'>=

d)<=

Question 43

The default standard output device for C programs is

a) Modem

b) Monitor

c) Disk

d) Printer

Question 44

The default standard input device for C++ program is

a) Mouse

b) Scanner

c) Keyboard

d) None of above

Question 45

When requesting multiple inputs from the user, they must be separated by

a) a space

b) a tab character

c) a new line character

d) any of the above

Question 46

The "return 0 "statement in main function indicates

a) The program did nothing i.e. completed zero tasks

b) The program will be executed without any error 

c) The program has not yet completed the execution 

d) None of the above

Question 47

What value must be returned to the operating system on the successful completion

of a program?

a) 0

b) -1

c) 1

d) Programs should not return a value

Question 48

What is the only function all programs must contain ?

a) start()

b) system()

c) main()

d) program() 

Question 49

What is the function from where C programs begins their execution?

a) start()

b) begin() 

c) main()

d) program()

Question 50

What punctuation is used to indicate the start and end of code blocks?

a) {and}

b) <and>

c) [and]

d) (and)

Question 51

Which of the following is the correct way of writing comments?

a) */comments/*

b) /*comment*/

c) **comment**

d) {comment}

Question 52

Which of the following is not a name of data type in C?

a) double

b) float

c) int

d) real

Question 53

Which relational operator is used for comparison?

a) :=

b) '==

c) equal

d)'=

Question 54

Which is the Boolean operator logical AND?

a) &

b) |

c) &&

d) ||

Question 55

Evaluate !(1 && !(0||1))

a) True

b) False

c) Error

d) Cannot be evaluated

Question 56

Find the output of the following program?

#include<stdio.h>

Void main()

{

char letter=''

printf("\n%c" letter)

}

a) A

b) 65

c) Syntax Error

d) Garbage value

Question 57

Find the output of the following program

#include<stdio.h>

void main()

{

int a; printf("%d",a^a);

}

a) 0

b) 1

c) infinite

d) Error

Question 58

Find the output of the following program?

#include<stdio.h>

void main()

{

int x=0,y=0;

x=(y=75)+9;

printf("\n%d %d", x, y);

}

a) 75,9

b) 75, 84

c) 84, 75

d) None of above

Question 59

Find the output the following C program? #include<stdio.h>

int main()

{

char x=65;

x=x+10;

printf("%d",x) return 0;

}

a) 21

b) 18

c) 15

d) None of above

Question 60

Find the output of the following c program? #include<stdio.h>

{

int i=4,ans;

ans +++ ++ +++i;

printf("%d", ans)

return 0;

}

a) 21

b) 18

c) 15

d) None of above

Question 61

Find the output of the following c program? #include<stdio.h>

{

int x=10;

printf("%d%d%d", x, x++, ++x);

return 0;

}

a) 11 11 11

b) 12 10 10

c) 12 11 10

d) 12 11 11

Question 62

Find the output of the following C program?

#include<stdio.h>

int main()

{

Printf("%d" sizeof(3 3))

Return 0;

}

a) 2

b) 4

c) 8

d) Compiler Error

Question 63

What are the different type of real data type in C? 

a) float,doble,char

b) short int,double,long int 

c) float,double, long double

d) double,long int, float 

Question 64

Which of the following is not logical operator in C?

a) &

b) &&

c) ||

d) !

Question 65

What is the output following C program?

#include<stdio.h>

int main()

{

int k,num=30;

k=(num < 10) ? 100:200;

printf("%d %d", num, k);

return 0;

}

a) 200 30

b) 30 200

c) 100 200

d) 500 500

Question 66

Find the output of the following C program?

#include<stdio.h>

int void()

{

int x,y,z; x=y=z=1;

|Z=++X||++y &&++Z;

printf("x=%d\t y=%d\t z=%d\n", x, y, z);

return 0;

}

a) x=2,y=1,z=1

b) x=2,y=2,z=1

c) x=2,y=2,z=2

d) x=1,y=2,z=1 

Question 67

C programming language is

a) object oriented programming language 

b) Procedure oriented programming language 

c) function oriented programming language 

d) None of above

Question 68

Which of the following special symbol allowed in a variable name?

a) _

b) *

c) - 

d) !

Question 69

Which of the following is not a keyword

a) void

b) int

c) main

d) for

Question 70

Which of the following is a keyword

a) main()

b) signed

c) integer

d) floating

Question 71

Which of the following identifier is incorrect

a) char

b) _int

c) _char

d) _float

Question 72

Which of the following identifier is incorrect

a) int_ 

b) 34_

c) son_ 

d) s1_

Question 73

Which of the following identifier is correct

a) #no

b) _no

c) '@no

d) &no

Question 74

Which of identifier is incorrect

a) number

b) num1

c) num_ber 

d) num ber

Question 75

Which of the following identifier is incorrect

a) Int

b) INT

c) 'Inte

d) int

Question 76

Which of the following identifier is correct

a) Simple_Int

b) void

c) #3_friends

d) 3 friends

Question 77

The memory space taken for a char type data is

a) 2 bytes

b) 4 bytes

c) 8 bytes

d) 1 bytes

Question 78

The memory space taken for a int type data is

a) 2 bytes

b) 4 bytes

c) 8 bytes

d) 10 bytes

Question 79

What will be the maximum size of a double variable?

a) 1 byte

b) 4 bytes

c) 8 bytes

d) 16 bytes

Question 80

A declaration float a,b; occupies ___of memory

a) 1 byte

b) 4 bytes

c) 8 bytes

d) 16 bytes

Question 81

The size of a String variable is

a) 1 byte

b) 8 bytes

c) 16 bytes

d) None of these

Question 82

Which of the following is an example of compounded assignment statement? 

a) a=5

b) a+=5

c) a=b=c

d) a=b

Question 83

The operator && is an example for _____ operator.

a) Assignment

b) Increment

c) Logical

d) Rational

Question 84

The memory space taken for a float type data is

a) 2 bytes

b) 4 bytes

c) 8 bytes

d) 10 bytes

Question 85

The memory space taken for a long double type data is

a) 2 bytes

b) 4 bytes

c) 8 bytes

d) 10 bytes

Question 86

The memory space taken for a long int type data is

a) 2 bytes

b) 4 bytes

c) 8 bytes

d) 10 bytes

Question 87

The memory space taken for a signed char type data is

a) 2 bytes

b) 4 bytes

c) 8 bytes

d) 1 byte

Question 88

Which of the following is not an escape sequence

a) \n

b) \b

c) c

d) \a

Question 89

Which of the following is an escape sequence

a) \w

b) le

c) \t

d) g

Question 90

Which of the is not an escape sequence

a) ll

b) l?

c) l'

d) \;

Question 91

Which of the following is an escape sequence

a) \:

b) 1+

c) l'

d) \;

Question 92

The space taken for a unsigned char type data is

a) 2 bytes

b) 4 bytes

c) 8 bytes

d) 1 bytes

Question 93

The space taken for a unsigned int type data is

a) 2 bytes

b) 4 bytes

c) 8 bytes

d) 10 bytes

Question 94

Match the column

i)\n          (a) back space

ii) \t         (b) tab

iii) \b       (c) beep sound

iv) la        (d) new line

a) i-A‚Ï¡-B‚ÏÏÏ-C,iv-D

b) i-D,ii-B,iii-A,iv-C

c) i-D.-B.ii-C,iv-A 

d) i-D.-C.iii-B,iv-A

Question 95

Suppose the following statements are written :

int i=9,j=6;

float x=0.5,y=0.5;

char a='a', b='b';

Find the values of the following expression (3*i-2*j)%(2*a-b)

a) 10

b) 15

c) 11

d) 16

Question 96

Suppose the following statements are written :

int i=9,j=6;

float x=0.5,y=0.5;

char a='a', b='b';

Find the values of the following expression (x>y) && (i>0) && (j>5)

a) -1

b) 0

c) 1

d) 2

Question 97

Suppose the following statements are written: Int i=9,j=6;

Float x=0.5,y=0.5;

Char a='a' b='b'

Find the values of the following expression

((x>y) && (i>0))|| (i>3)

a) -1

b) 0

c) 1

d) 2

Question 98

Suppose the following statements are written:

Int i=9,j=6;

Float x=0.5,y=0.5;

Char a='a' b='b'

Find the values of the following expression ++i

a) 10

b) 11

c) 9

d) 8

Question 99

Find the output of the following program

#include<stdio.h>

Void main()

{

int x=4,y=9;

int z; z=(x++)+(--y)+y; printf("Value=%d\n" z)

}

a) value=22

b) value=19

c) value=20

d) value=21

Question 100

Find the output of the following program

#include<stdio.h>

Void main()

{

int a,b,c;

a=2; b=5; c=10;

printf("value=%d\n", (a+b*-c));

printf("value=%d\n", (-c/b*c-a)); printf("value=%d\n", (-a+ ++b %a));

}

a) value=70

value=-18

value=0

b) value=-48

value=-22

value=0

c) value=-48

value=-22

value=-2

d) value=20

value=16

value=-2

Question 101

Find the output of the following program

#include<stdio.h>

Void main()

K

int a=5,b=3;

float c; c=a/b;

printf("%d\n", c);

}

a) 0

b) 1

c) -1

d) None of the above

Question 102

Find the output of the following program

#include<stdio.h>

Void main()

{

clrscr();

int a=10,b,c;

c=b=a;

b- a--;

C-=--a;

a-=--a;

a-=--a-a--;

printf("a=%d\nb=%d\nc=%d\n", a, b, c);

}

a) a=7 b=1

c=3

b) a=5

b=-1

C=1

c)  a=6

b=6

C=2

d) None of the above

Question 103

Find the output of the following program

#include<stdio.d>

Void main()

{

int k=3,1=4,m;

m=++k +|--;

printf("Value of m %d\n", m);

m=k++ + --l;

printf("Value of m %d\n", m);

}

a) Value of m7

Value of m 6

b) Value of m 8

Value of m 6

c) Value of m7

Value of m 6

d) None of the above

Question 104

Find the output of the following program 

#include<stdio.h>

void main()

{

int a=1,b=2,c=3,d=4.75,x;

x=++a+b++ * ++c % d++;

printf("%d %d%d %d %d", a, b, c, d, x);

}

a) 23452

b) 2341

c) 12342

d) 12345 

Question 105

Find the output of the following program?

#include<stdio.h>

void main()

{

char letter=' ';

printf("\n%d", letter);

}

a) 32

b) 68

c) Error

d) Garbage Value

Question 106

Find the output of the following program?

#include<stdio.h>

#include<conio.h>

void main()

{

int i=4,z=12;

clrscr();

if(i=5 || z>50)

printf("\n Samosa");

else

printf("\n Dosa");

getch();

}

a) Samosa

b) Dosa 

c) Error

d) None of the above

Question 107

Find the output of the following program 

#include<stdio.h>

#include<conio.h>

void main()

{

int i=4,z=12; clrscr();

if(i=5&& z>50) printf("\n Let us C");

else

printf("\n Let us Not C");

getch();

}

a) Let us C

b) Let us Not C

c) Error

d) none of the above

Question 108

Find the output of the following program?

#include<stdio.h>

#include<conio.h>

void main()

{

int p=8,q=20;

if(p==5 && q>5)

printf("\n Why not C");

else

printf("\n Why C");

getch();

}

a) Why not C

b) Why C

c) Why not C and Why C

d) None

Question 109

Find the output of the following program?

#include<stdio.h>

#include<conio.h>

void main()

}

int j=4,k;

k=!5 &&j; printf("\n k= %d",k);

}

a) 4

b) 5 

c) 0

d) 45

Question 110

Find the output of the following program? 

#include<stdio.h>

#include<conio.h>

void main()

{

int i=0;

clrscr();

for(;i<=2;)

printf("%d", ++i);

getch();

}

a) 1 2 3

b) 0 1 2

c) 2 3 4

d) Error

Question 111

Find the output of the following program?

#include<stdio.h>

#include<conio.h>

void main()

{

int i=4;

clrscr();

printf("%d\t%d\t%d\t",i,i-,--i);

getch();

}

a) 2 3 2

b) 4 3 2

c) 2 2 2

d) 3 3 3

Question 112

Find the output of the following program?

#include<stdio.h>

#include<conio.h>

void main()

{

int i=4; clrscr();

printf("%d",i);

printf("\n%d",i--);

printf("\n%d",--i);

getch();

}

a) 4 4 2

b) 4 4 3 

c) 4 4 4 

d) 4 3 2

Question 113

Find the output of the following program? 

#include<stdio.h>

#include<conio.h>

void main()

{

int i=4;

printf("%d\t%d\t%d\t",i,i++,++i);

getch();

}

a) 6 5 6

b) 6 5 4

c) 6 6 6

d) 5 5 5

Question 114

Find the output of the following program?

#include<stdio.h>

#include<conio.h>

void main()

{

int x=5,y;

y=x++;

printf("%d %d",x,y);

getch();

}

a) 6 5

b) 5 6

c) 6 6

d) 5 5

Question 115

Find the output of the following program?

#include<stdio.h>

#include<conio.h>

void main()

{

int i=5;

if(i==0)

{

printf("I am Zero");

}

else

{

printf(" I am Hero");

}

getch();

}

a) I am in Hero

b) I am in Zero

c) Error

d) None of above

Question 116

Why this program runs infinite times

#include<stdio.h>

#include<conio.h>

void main()

{

int i;

for(i=32200;i<=32768;i++)

{

printf("The Value I %d",i);

}

}

a) The range of Integer

b) It will not infinite

c) Error

d) None of the above

Question 117

What is the error in following code?

if(z=100)

printf("z is 100");

a) 100 should be written in double quotations in the first line

b) variable z should be inside double quotations in the first line

c) Mistakes in the equals to operator

d) There is no semicolon (;) at the end of first line

Question 118

Which of the following is a decision statement in C?

a) if-else

b) switch-case

c) both a & b

d) do-while

Question 119

The continue statement is used to:

a) resume the program when it is hanged

b) resume the program if a break statement is given

c) skips the rest of the loop in current iteration

d) none of the above

Question 120

Observe the following block of code and determine what happens when x=2? switch(x)

{

case 1: printf("x is 1");

break;

case 2:

case 3: printf("x is 3");

break;

}

default:

printf("X is not within the range");

a) Program jumps to the end of switch statement since there is nothing to do for

x=2

b) The code inside default will run since there is no task for x=2,so

c) Will display x is 3,and then come outside the switch statement

d) None of above

Question 121

Which of the following is false for a "switch" statement in C?

a) break statement is false is compulsory after each case

b) default statement is compulsory

c) There is a limit on the maximum number of cases

d) None of above

Question 122

Find the output of following code

#include<stdio.h>

void main()

{

int s=0;

while(s++<10)

{

if(s>3&& s<10)

continue;

printf("\n%d\t", s);

}

}

a)  1 2 3 4 5 6 7 8 9

b)  1 2 3 10

c)  4 5 6 7 8 9 10

d)  4 5 6 7 8 9

Question 123

Find the output of the following c code

#include<stdio.h>

#include<string.h>

void main()

{

int i=0;

for(;i<=2;)

printf("%d", ++i);

}

a) 0 1 2

b) 1 2 3

c)01 2 3

d) Infinite Loop

Question 124

How many times "C" is get printed? 

#include<stdio.h>

void main()

{

int x;

for(x=0;x<=10; x++)

{

if(x<5)

continue;

else

break; 

printf("C");

}

}

a)5 Times 

b)11 Times

c) 0 Times

d) 10 Times

Question 125

Find the output of the following program

#include<stdio.h>

void main()

{

int x=500,y=100,z;

if(!x>=400)

y=300;

z=200;

printf("y=%d z=%d\n", y, z);

}

a) y=100

z=200

b) y=300

z=garbage

c) y=100

z=garbage

d) y=300

Z=200

Question 126

find the output of the following program

#include<stdio.h>

void main()

{

C

int i=1;

switch(i)

{ printf("Hello\t");

case 1:

printf("Hi\t");

case 2:

printf("\nBye\n");

break

}

}

a) Hi

b) Bye

c) Bye Hi

d) Hello Bye

Question 127

To repeat a set of the statements for 25 times, which kind of statement will be required?

a) Iterative

b) Selective

c) Either a or b can be used

d) None of the above

Question 128

To perform one of the many operations selected based on a condition, which kind of statement will be required?

a) Iterative

b) Selective

c) Either a or b can be used

d) None of the above

Question 129

"break" statement is compulsory after every case in the "switch-case" statement 

a) True

b) False

c) Depends on the condition

d) None of the above

Question 130

"continue" statement when executed the control is transferred

a) Outside the loop,to the next statement after the loop

b) beginning of the loop i.e. to the first statement in the loop

c) outside the function, to the next function in the program

d) beginning of the function i.e. to the first statement in the function 

Question 131

Find the output of the following program

#include<stdio.h>

void main()

{

int i,j;

for(i=1;i<=5;i++)

{

for(j=1;j<=i;j++)

{

printf("1");

}

printf("\n");

}

}

a) 1

     11

     111

     1111

     111111

b) 1 1 1 1 1

c) 1

    1

    1

    1

    1

d)1 1 1 1 1

    1 1 1 1

    1 1 1

    1 1

    1

Question 132

The break statement is used to exit from a

a) DO loop

b) FOR loop

c) SWITCH statement

d) All of the above

Question 133

A leading "0" indicates that the number following is an octal (base 8) number. For example the compiler will interpret "011" as the octal number 011 and use as decimal value.

Find the following program

#include<stdio.h>

void main()

{

int x=011,i;

for(i=0;i<x;i+=3)

{ printf("Error")

continue;

printf("Exit")

}

}

a) EnterExitEnterExitEnterExit

b) EnterEnterEnter

c) EnterEnterEnterExit

d) None of the above

Question 134

Which is the correct way to declare a pointer?

a) int_ptr;

b) int *ptr;

c) *int ptr;

d) None of these.

Question 135

The return type of a function that does not have any return type is declared

a) long

b) double

c) void

d) int

Question 136

Parameters passed to a function are separated with

a) comma

b) semi-colon(;)

c) colon(:)

d) None of the above

Question 137

Variables declared inside the parenthesis of a function have__________________ visibility.

a) Local

b) Global

c) Module

d) Universal

Question 138

String is an array of character arrays terminated with__________

a) \n

b) it

c) 10

d) \1

Question 139

According to the following code, select the best suitable 

int x=5,y=3,z;

a=add(&x,&y);

a) The function add is called by passing the values

b) The function add is called by passing reference

c) Both (a and b) of above

d) None of above

Question 140

If the type specifier of parameters of a function call is followed by an ampersand (&) and then the variable names, that function call is

a) pass by value

b) pass by reference

c) pass by variables

d) none of above

Question 141

When an array is passed to a function, it can said that________________________________ is passed

a) Address of the array

b) Value of the first element of the array

c) Address of the first element of the array 

d) Number if elements in the array 

Question 142

Find the output of the following program?

#include<stdio.h>

void main()

{

char *str="Hello world";

printf("%s", str);

}

a) Hello world

b) Error

c) Garbage value

d) None of the above

Question 143

Find the output of the following program?

#include<stdio.h>

int main()

{

char str[]="C-program";

int a = 5;

printf(a >10?"Ps\n":"%s\n", str);

return 0;

}

a) C-program

b) Ps

c) Error

d) None of the above

Question 144

Every program must have atleast ____________function(s)

a) 1

b) 2

c) 3

d) None of the above

Question 145

A void return type for a function indicates that a) The function cannot return any data

b) The function can return any type of data

c) The function can return any type of data except for "int" 

d) None of the above

Question 146

The value returned by a function is returned to the

a) main function

b) Operating System

c) caller function

d) called function

Question 147

The parameters passed by the caller function are called as the_________parameters

a) actual

b) formal

c) informal

d) reference

Question 148

The prototype of a function can be written

a) only outside a function

b) only inside a function

c) both inside and outside a function

d) only with prefix'#'

Question 149

A recursive function may or may not have a condition such that there is an exit from the function calling itself again

a) True

b) False

c) ?

d) ?

Question 150

The actual and formal parameters are

a) same variables with different names

b) different variable name with same memory location 

c) different memory location with different variable names 

d) different memory location with same or different names

Question 151

The starting index of an array is always_______________

a) 0

b) 1

c) 2

d) None

Question 152

The index of the last element of an array of "n? elements will be_____

a) n+1

b) n

c) n-1

d) none of the above

Question 153

The memory space allocated to the array declared as:

int a[10];

will be_________bytes

a) 10

b) 20

c) 30

d) 40

Question 154

The 10th element of an array "a" can be accessed as

a) a[10]

b) a[11]

c) a[9]

d) a[8]

Question 155

An array of characters terminated with a null character is called as________

a) pointer

b) string

c) structure

d) None of the above

Question 156

The ASCII value of the null character stored at the end of the string is_________

a) 65

b) 97

c) 0

d) None of the above

Question 157

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

a) getchar()

b) putchar()

c) gets() 

d) puts()

Question 158

The header file that has various string functions like strcpy(),strcat(),ect is

a) stdio.h

b) conio.h

c) string.h

d) math.h 

Question 159

The initial of an automatic storage class variable is ______________

a) zero(0)

b) garbage

c) 1

d) none of above

Question 160

What is the output of the above program code?

#include<stdio.h>

void main()

{

int i=3,*p.**p1;

p=&i;

p1=&p,

printf("%d %d %d", *p, **p1, *(*p1));

}

a) 4 4 4

b) 0

c) 3 3 3

d) 4 3 3

Question 161

An entire structure or union variable can be assigned to another structure or union variable if

a) The two variables have same composition

b) the two variable have same type

c) Assignment of one structure or union variable to another is not possible 

d) None of the above

Question 162

Find the output of the following program

#include<stdio.h>

void main()

{

int i=32;

printf("%d", *ptr);

char *ptr=(char*)&i;

}

a) 1

b) 32

c) compiler error 

d) None of the above

Question 163

Find the output of the following program

#include<stdio.h>

void main()

{

double p,q;

printf("%d", sizeof(p)+sizeof(q));

}

a) 12

b) 8

c) 4

d) 16

Question 164

Which of the following is not user defined data type?

I:

struct book

{ char name[10];

int pages;

};

II:

long int x=2.35;

III:

enum day{Sun, Mon, Tue, Wed};

a) I

b) ll

c) III

d) Both I and II

Question 165

Find the output of the following program

#include<stdio.h>

void main()

{

struct employee

{

char name[10];

int age; 

float sal;

};

struct employee e; 

e.name="Rajesh";

printf("%d %f", e.age, e.sal);

}

a) 0,0.000000

b) Garbage

c) error

d) None of the above

Question 166

What is the similarity between a structure,union and enumeration?

a) All of them let you define new values

b) All of them let you define new datatype values

c) All of them let you define new pointers

d) All of them let you define new structures

Question 167

With reference to the pointers the "*" operator returns the ______________________

a) address

b) value

c) product

d) none of above

Question 168

Find output of the following program

#include<stdio.h>

void main()

{

int a, *p, **p1

a=125;

p=&a;

p1=&p;

printf("%d\n", a);

printf("%x\n", p);

printf("%x\n", p1);

printf("%d\n", *p) ;

printf("%x\n", *p1);

printf("%d\n", **p1);

}

a) 125

    125

    125

    125

    125

     125

b) 125

Address of variable a

Address of pointer variable p

     125

Address of variable a

     125

C) 125

d) 125

Address of variable a

Address of variable a

125

Address of variable a

125

Question 169

Read the statements given bellow and select the correct statement

int a, *p, **p1;

p=&a;

p1=%p;

a) p1 is a pointer to pointer p

b) p is pointer to variable a

c) both (a) and (b)

d) none of the above

Question 170

The total memory space allocated for a variable of a structure is equal to___________

a) Memory space required by the largest member variable of the structure

b) sum of memory space required by the all member variable of the structure

c) 100 bytes

d) none of the above

Question 171

Which of the following operator is used to select a member of a structure variable

a) .

b) ,

c) :

d) ;

Question 172

Select the correct answer

int "p,i[3];

i[0]=0;i[1]=1;i[2]=2;

P=&[1];

what is the value of expression *P++?

a) 0

b) 1

c) 2

d) Undefined

Question 173

In which of the following loop,the loop body continues to executes as long as the answer to the controlling question is yes, or true.

a) do-then

b) do-when

c) do-until

d) do-while

Question 174

Which of the following statement cause program control to end up almost anywhere

in the program?

a) go to

b) for

c) while

d) do-while

Question 175

Which of the following statement allows us to make a decision from the number of

choices?

a) Break

b) Switch

c) For coding the program

d) Go-to

Question 176

Which of the following keyword is followed by an integer or character constant? 

a) switch

b) case

c) For coding the program

d) void

Question 177

Which of the following enhances the versatility of the computer to perform a set of

instructions repeatedly?

a) Function

b) Loop

c) Header files

d) Statement

Question 178

Which of the following contains parenthesis after the "while" loop?

a) Condition

b) Statement

c) Count

d) Value

Question 179

Which of the following loop uses three things initialization, condition to terminate loop and increasing the value of loop counter?

a) for

b) while

c) goto

d) switch

Question 180

The three things inside the for loop are separated by

a) colon

b) comma

c) semicolon

d) hyphen

Question 181

Which of the following statement associated with an "if" ?

a) switch

b) goto

c) break

d) do while

Question 182

"do while" loop is useful when we want that statement within the loop must be executed

a) Only Once

b) At least Once 

c) More than once

d) None of above

Question 183

Which of the following statement allows the programmer to make the control to

the beginning of the loop, without executing the statement inside the loop?

a) while

b) continue

c) go to

d) if

Question 184

Which of the following can be replaced by if

a) switch

b) while

c) continue

d) for

Question 185

Which of the following statement is useful while writing menu driven programs

a) while

b) break

c) switch 

d) if

Question 186

Which of the following is self contained block of statements that perform a coherent task  of some kind?

a) function

b) loop

c) Statement

d) body of program

Question 187

The function gets called when the function name is followed by

a) colon

b) semicolon

c) statement 

d) braket

Question 188

The mechanism used to convey information to the function is the

a) argument

b) commands 

c) loops

d) statements 

Question 189

Find the output of the following program?

#include<stdio.h>

void main()

{

int array[]={10,20,30,40};

printf("%d", -2[array]);

}

a) -60

b) -30

c) Garbage value

d) Compiler Error

Question 190

A structure is a collection of

a) Integers

b) Float

c) Characters

d) All of the above

Question 191

A pointer holds the

a) Address of another variable

b) Address of another variable of same type

c) Value of a variable

d) Name of a variable

Question 192

Default return type of a function is

a) Integer

b) Character 

c) Float 

d) Void

Question 193

A string is a/an

a) Array of character

b) Array of character terminated by '\0'

c) Array of integers

d) None of the above

Question 194

Function of strcpy()

a) Copy a file

b) Input a String

c) Copy a string

d) Delete a string

Question 195

How many keywords are available in c language

a) 30

b) 32

c) 64

d) 50

Question 196

Which of the followings is not a keyword of c language

a) while

b) do-while

c) for

d) if

Question 197

The C source file is processed by the_______

a) Compiler

b) Interpreter

c) Assembler

d) Both interpreter and compiler

Question 198

What is the extension of c programming 

a) .C

b) .CPP

c) .C99

d) .h

Question 199

For which type, the format specifier "%" is used?

a) int

b) cahr

c) double 

d) flaot

Question 200

Which is the correct format specifier for double type value in C?

a) %d

b) %f

c) %lf

d) %db

ANSWER











Comments

Popular posts from this blog

How Does Crypto Work?