cds online bits

1. Representing various steps in a flow diagram is called as
(a) diagram
(b) flow chart
(c) program
(d) paint
2. A block is enclosed with pair of
(a) ( )
(b) [ ]
(c) <>
(d) { }
3. Which of the following is an incorrect variable name.
(a) age
(b) string
(c) else
(d) name
4. Which of the following is a primary data type?
(a) array
(b) int
(c) enum
(d) typedef
5. In the following, which is not valid character constant ?
(a) ‘2’
(b) “#”
(c) ‘#’
(d) ‘B’
6. Which of the following operators takes only integer operands?
(a) *
(b) %
(c) /
(d) +
7. The equality relational operator is represent by
(a) =
(b) ==
(c) .EQ.
(d) :=
8. What is the value of !0?
(a) -1
(b) 1
(c) 0
(d) 00
9. The operation between integer and float always yield result in
(a) character
(b) float
(c) constant
(d) Integer
10. The output of the following program is
main( )
{int i=2;
printf(“%d %d %d”,i++,i,++i);
}
(a) 3 3 3
(b) 2 2 4
(c) 2 3 4
(d) 2 3 3
11. Which is syntactically correct:
(a) if (a.eq. 10) {; } else if (a<10) {; }
(b) if (a:=10) {; } else if (a<10) {; }
(c) if (a eq 10) {; } else if (a<10) {; }
(d) if (a==10) {; } else if (a<10) {; }
12. Which command is used to skip the rest of a loop and carry on from the top of the loop again?
(a) continue;
(b) break;
(c) resume;
(d) switch;
13. What will happen if you try to put so many values into an array during the initalization such that its size is
exceeded.
(a) Error message from the compiler
(b) Possible system malfunction
(c) Nothing
(d) Last element data may be overwritten
14. The total number of elements in array a[n][m]
(a) (n-1)*(m-1)
(b) n*m
(c) n+m
(d) (n+1) * (m+1)
15. What is the output of the following program?
void main()
{char name[4] =
{‘R’, ‘
A’, ‘
V’ ‘
I’ };
printf (“%s”, name);
}
(a) RAVI followed by a garbage value
(b) RAV
(c) only garbage value
(d) RAVI
16. If the number of actual arguments are not matching with formal arguments then
(a) no error
(b) compiler error
(c) logical error
(d) syntax error
17. output of the following program is
#include< stdio.h>
main()
{int a,count;
int funct( int count);
for( count=1;count<=5;++count)
{a=funct1(count);
printf(“%d”,a);
}}
int funct1(int x)
{int y;
y= x*x;
return(y);
}
(a) 36
(b) 25
(c) 25 9 16
(d) 1 4 9 16 25
18. What will be the output of the following program?
void main()
{char txt[ ]
=

ABC\0DEF”;
printf(“%s %d”, txt, sizeof (txt));
}
(a) ABC 8
(b) ABC\0DEF 7
(c) ABCDEF 8
(d) ABC 4
19. Consider the following program
main()
{int a= 2;
printf(“%d”,a);
modify(a);
printf(“%d”,a);
}void modify(int a)
{a=a*3;
printf(“%d”,a);
return;
}The output of the above program is
(a) 2 6 2
(b) 6 2 6
(c) 6 6 2
(d) 2 6 6
20. How would you declare a constant of 5 called “MYCONST”?
(a) var int MYCONST=5
(b) int myconst = 5;
(c) constant MYCONST = 5;
(d) #define MYCONST 5
B D C B B B B B B A D A A B A B D A A D
1. The symbol with rounded ends is used to represent
(a) equation processing
(b) start/ stop
(c) decision making
(d) input/output
2. The constant ‘\00 is called as
(a) nill
(b) full
(c) zero
(d) null
3. In the following which one is not a C keyword?
(a) for
(b) case
(c) choice
(d) volatile
4. Identify the wrong datatype declaration
(a) long double ld;
(b) unsigned long int a,b;
(c) long float f1;
(d) signed a;
5. Which of the following would you use to declare a character array called str large enough to fit the word HELLO
(a) char str[5]
(b) char str[3]
(c) string str;
(d) char str[6]
6. Associativity of arithmetic operators is from
(a) right to left
(b) left to right
(c) middle to right
(d) middle to left
7. What is the result of 5 &&2 ?
(a) 0
(b) 5
(c) 1
(d) 2
8. What is the value of !0?
(a) 00
(b) 1
(c) -1
(d) 0
9. x = 9 - ((12 / 3 ) + 3 * 2 ) - 1 what is the value of x.
(a) -2
(b) 2
(c) 8
(d) 10
10. How would you copy the name “Hello” to a character array (i.e. string) declared as char str[10];
(a) printf( str, “Hello” );
(b) strcat(str,“Hello”);
(c) strcpy( str, “Hello” );
(d) str = “Hello”;
11. The case statement in switch ( ) is separated by
(a) goto
(b) break
(c) exit
(d) continue
12. What would be the final value of x after execution of the following program?
# include (stdio.h)
void main()
{int x = 1;
do while (x<=10)
{x++;
} while (x< = 5);
printf (“\n x = %d”, x);
}
(a) x = 2
(b) 10
(c) x = 11
(d) x = 6
13. What will happen if you try to put so many values into an array during the initalization such that its size is
exceeded.
(a) Nothing
(b) Last element data may be overwritten
(c) Possible system malfunction
(d) Error message from the compiler
14. Consider the statement
int val[2][4]={1,2,3,4,5,6,7,8 }; 4 will be the value of
(a) val[1][1]
(b) val [0] [3]
(c) val[1][4]
(d) val[0][4]
15. Which function is used to convert a string of digits into their integer values
(a) btoi
(b) itoa
(c) atoi
(d) asctoint
16. The parameters of the called function are called
(a) casual parameters
(b) formal parameters
(c) usual parameters
(d) actual parameters
17. Recursion means
(a) Function calling a same function
(b) Function without a return value
(c) Function calling a function
(d) Passing a function to a function
18. The strcat( ) function is used for
(a) Multiplication
(b) Addition
(c) Concatenation
(d) Joining
19. The lifetime of external variables is
(a) only in main function
(b) only within the function where it is declared
(c) only in some specified functions
(d) throughout the program
20. #define PI 3.14 is a kind of .
(a) Processor directive
(b) Pre compiler directive
(c) Preprocessor directive
(d) Compiler directive
B D C D D B C B A C B C D B C B A C D C
1. What symbol is used to represent input/output operations in a flow chart.
(a) Parellograms
(b) circles
(c) Rectangles
(d) Rectangle with rounded end
2. The ANSI C standard recognizes maximum length of a variable up to
(a) 31 characters
(b) unlimited characters
(c) 15 characters
(d) 8 characters
3. Which of the following is an incorrect variable name.
(a) string
(b) name
(c) else
(d) age
4. Identify the wrong datatype declaration
(a) unsigned long int a,b;
(b) signed a;
(c) long float f1;
(d) long double ld;
5. C variable cannot start with
(a) an upper case letter
(b) a number
(c) a lower case
(d) an underscore
6. The operator ++ is called as operator
(a) special increment
(b) decrement
(c) double addition
(d) increment
7. How many logical operators C provides?
(a) 3
(b) 2
(c) 4
(d) 1
8. The symbol for right shift operator is
(a) <=
(b) − >
(c) >>
(d) >
9. The expression M = 4+2% - 8 evaluates to
(a) 12
(b) 6
(c) 4
(d) -6
10. Which of the following statements would read a single character from the keyboard and place the result in a character
variable ‘ch’ defined as: char ch;
(a) while(!kbhit)
(b) printf( “%c”, ch );
(c) ch = getch( );
(d) getkeyb ( ch );
11. The default statement is executed when
(a) all the case statements are false.
(b) one of the cases is false
(c) one of the cases is true
(d) the condition is not properly defined
12. consider the following program fragment .
char c = ‘a’;
while (c++ ¡= ‘z’)
putchar(xxx);
If the required output is a sequence of alphabets a to z written in a row then the value of the varriable xxx should be
(a) c
(b) b
(c) -c
(d) c-1
13. The value within the [] brackets in an array declaration specifies
(a) address value
(b) value of the array element
(c) size of an array
(d) subscript value
14. Dynamic memory allocation in array results in
(a) allocation of memory at debugging time
(b) allocation of memory at compile time
(c) allocation of memory at file saving time
(d) allocation of memory at runtime
15. Which function is used to convert a string of digits into their integer values
(a) itoa
(b) atoi
(c) asctoint
(d) btoi
16. The names of actual parameters and formal parameters
(a) almost same
(b) should be same
(c) always same
(d) need not be same
17. What is the output of the following program?
main()
{int x , y;
x = 10; y = 100;
change (x,y)
printf (“%d, %d”, x,y);
}change (
int x, int y);
{int k;
k = a; a = b; b = k;
}
(a) 100, 100
(b) 10, 10
(c) 10, 100
(d) 100, 10
18. What is the output of the following program
void main()
{char nm[ ]
=
{‘H’, ‘
E’, ‘\0’};
int x=0 ;
while (nm[x]! = \0)
printf (“%c”, nm [x++]);
}
(a) \0
(b) H
(c) HE\0
(d) HE
19. In case both external and autovariables are declared with the same name in a program, the priority is given to
which of the variables
(a) depends on logic
(b) complier dependent
(c) external variable
(d) auto variable
20. Which of the following is a correct way of defining a symbolic constant pie in C
(a) # define pie = 22/7
(b) # Define pie 22/7
(c) #define pie= 3.142
(d) #define pie 22/7
A A C B B D A C B C A D C D B D C D D D
1. Pick up the wrong sequence
(a) Data analysis, Development of algorithm, Program coding
(b) Program coding, Debugging, Data analysis
(c) Problem identification, Task analysis, Data analysis
(d) Problem coding, Testing, Debugging
2. A machine language program consists of instructions written in
(a) english like words
(b) keywords
(c) mnemonics
(d) 0’s and 1’s
3. Which of the following is not a keyword
(a) constant
(b) signed
(c) typedef
(d) register
4. What is the size of long double variable
(a) 8 bytes
(b) 16 bytes
(c) 10 bytes
(d) 4 bytes
5. Variables are initialized in C, using
(a) = =
(b) >
(c) : =
(d) =
6. The operator % yields
(a) remainder after integer division
(b) Percentage value
(c) Fractional part
(d) quotient value
7. The equality relational operator is represent by
(a) .EQ.
(b) :=
(c) =
(d) ==
8. The symbol for one’s complement operator is:
(a) ^
(b) _
(c) |
(d) &
9. Which of the following arithmetic expression is invalid
(a) 7.5 % 3
(b) 9% -3
(c) -9%3
(d) 2 + 3/5
10. Consider scanf(“%2d”, &n); and the input data is 3142 then what value is assigned to n
(a) 42
(b) 31.42
(c) 31
(d) error
11. Switch case construct is an alternative for
(a) Do-while loop
(b) For loop
(c) If-else construct
(d) While loop
12. For (I=0; I<=10, I++) this loop will execute times
(a) 9
(b) 10
(c) 12
(d) 11
13. The total memory required for an array
(a) sizeof (datatype) * 2
(b) size of (array) * datatype
(c) size of (datatype) * size of used array elements
(d) sizeof (datatype) * sizeof array
14. Dynamic memory allocation in array results in
(a) allocation of memory at debugging time
(b) allocation of memory at file saving time
(c) allocation of memory at compile time
(d) allocation of memory at runtime
15. The following program fragment
int m,n,b; char wer[80]; m=n=b=8;
sprintf(wer,“%d%d%d”,m,n,b);
puts(wer);
(a) prints the string 888
(b) prints the null string
(c) prints the string 8 8 8
(d) prints 888 888 888
16. The parameters of the calling function are called
(a) formal parameters
(b) usual parameters
(c) casual parameters
(d) actual parameters
17. When you pass an array as an argument to a function, what actually gets passed
(a) Address of the array
(b) Number of elements of the array
(c) Address of the last element of the array
(d) Values of the elements of the array
18. What will be the output of the following program?
void main()
{char txt[ ]
=

ABC\0DEF”;
printf(“%s %d”, txt, sizeof (txt));
}
(a) ABCDEF 8
(b) ABC\0DEF 7
(c) ABC 8
(d) ABC 4
19. The following program
main()
{inc(); inc(); inc();
}inc()
{static int x;
pritnf(“%d”, ++x);
}
(a) Prints 0 1 2
(b) Prints three consecutive unpredictable numbers
(c) Prints 1 1 1
(d) Prints 1 2 3
20. Which of the following is a correct way of defining a symbolic constant pie in C
(a) # define pie = 22/7
(b) # Define pie 22/7
(c) #define pie 22/7
(d) #define pie= 3.142
B D A C D A D B A C C D D D A D A C D C
1. C language has been developed by
(a) Dennis Ritchie
(b) Peter Norton
(c) Martin Richards
(d) Ken Thompson
2. The function getchar( ) is used to read
(a) a boolean value
(b) a word
(c) a string
(d) a character
3. What are the smallest individual units in a program
(a) record
(b) Functions
(c) Structures
(d) Tokens
4. If the signed integer needs two bytes of storage then maximum value of signed integer is
(a) 215-1
(b) 216
(c) 215
(d) 216-1
5. The value of an automatic variable that is declared but not initialized will be
(a) -1
(b) 0
(c) 1
(d) unpredictable
6. Which of the following statements will subtract a value of 2 from the variable ‘i’?
(a) i–;
(b) i+=-2;
(c) i- = 2;
(d) i= -2;
7. What is output of following Program?
main( )
{int x=10,y=5,p,q ;
p= x> 9 ;
q= x > 3 && y != 3 ;
printf( “p=%d q=%d ” ,p,q) ;
}
(a) p = 1 q= 0
(b) p =0 q = 0
(c) p = 1 q = 1
(d) p = 0 q = 1
8. main( )
{ int a=0; if(a) printf(“%d”,++a); else printf(“%d”, a+=2) ; } the output is
(a) 0
(b) 2
(c) 3
(d) 1
9. If y is of integer type variable then the two expressions.
3*(y-8)/9 and (y-8)/9*3 yield the same value if
(a) y-8 is an integer multiple of 9
(b) y-8 is an integer multiple of 3
(c) y is an odd number
(d) y is an even number
10. The values of a,b and c in the statement scanf(“%d%f%c”,&a,&b,&c); if the input stream is 15.75 23 x is
(a) 15 0.75 x
(b) 15 23.00 x
(c) 15 0.75 2
(d) 15 23 x
11. Which of the following statement is not true about the switch statement
(a) In switch() case statement nested if can be used
(b) No two case statements have identical constants in the same switch
(c) The switch() can evaluate relational or logical expressions
(d) Character constants are automatically converted into integer
12. How many while statements are possible in do.... While loop?
(a) 2
(b) any number
(c) 1
(d) 3
13. The number of elements in array declaration
(a) requires to be specified
(b) assume default size as ‘0’
(c) dynamically identifies based on largest index used in program
(d) does not require to be specified
14. An array which contains two subscripts, to represent each element is called as
(a) three dimensional
(b) two dimensional
(c) one dimensional
(d) multidimensional
15. putchar() and getchar() are both
(a) type declaration statements
(b) assignment statements
(c) input and output statements
(d) control statement
16. C facilities
(a) both top-down and bottom-up programming
(b) no modular programming
(c) bottom-up modular programming
(d) top-down modular programming
17. What is the output of
main()
{int x, change (int);
x = 20;
change (x);
printf (“%d”, x);
return 0;
}change (
int x);
{x = 10;
printf (“%d”. x);
}
(a) 10 30
(b) 10 20
(c) 10 10
(d) 20 20
18. String handling functions are kept in
(a) string.h
(b) conio.h
(c) stdlib.h
(d) stdio.h
19. The lifetime of automatic variables is
(a) limited to some functions
(b) until the end of the function
(c) throughout the program
(d) limited to main function
20. #include is a directive
(a) processor
(b) pre-processor
(c) complier
(d) pre-compiler
A D D A D C C B A C B B A B C D B A B B
1. What is the appropriate order of refinement in a problem solving.
(a) pseudo code, flowchart, program
(b) program, flow chart, pseudo code
(c) flow chart, program, pseudo code
(d) flow chart, pseudo code program
2. The purpose of main function is
(a) to stop algorithm
(b) to stop program execution
(c) to start algorithm
(d) to start program execution
3. Which of the following is an incorrect variable name.
(a) name
(b) else
(c) age
(d) string
4. What is range of char data value?
(a) 0 to 255
(b) -64 to 64
(c) -127 to 128
(d) -128 to 127
5. Which of the following statements is wrong
(a) mes = 123.56
(b) 3+a=b;
(c) This = ‘T’ * 20 ;
(d) con = ‘T’ * ‘A’ ;
6. The operator ++ is called as operator
(a) special increment
(b) decrement
(c) double addition
(d) increment
7. How many logical operators C provides?
(a) 2
(b) 4
(c) 3
(d) 1
8. The symbol for one’s complement operator is:
(a) ^
(b) _
(c) |
(d) &
9. The operation between integer and float always yield result in
(a) float
(b) Integer
(c) character
(d) constant
10. What is the output for the following program
main( )
{ int m=5,y;
y=++m;
printf(“%d,%d”m,y);
}
(a) 6,6
(b) 5,6
(c) 7,5
(d) 5,5
11. Output of the following programs is
main()
{int a,b,c;
scanf( %d %d ”, &a,&b);
if(a>b)
printf(“%d”,a);
else
printf(“%d”,b);
}if input is 10 5
(a) 5
(b) 20
(c) 10
(d) 105
12. What is the output of the following program
main()
{ int a=123;
int r, rev=1;
while (a > 0)
{a=a%10;
rev=rev*10+a;
a=a/10;
}printf(“%d”,rev);
}
(a) 321
(b) 3 0 2 0 1
(c) 123
(d) 3
13. What will happen if you put too few elements in an array when you initialize it.
(a) Error message from the compiler
(b) Error at run-time
(c) Unused elements will be filled with 0’s or garbage
(d) Possible system malfunction
14. # define six 2*3 main() { int x=12/six; print (“%d”,x); }
(a) 2
(b) 12
(c) 8
(d) 18
15. char city [9] = “NEW YORK”; printf(“%c”, city[4]);
what is the output?
(a) N
(b) Y
(c) ‘K’
(d) a blank character
16. Actual and formal parameters must agree in
(a) data types
(b) names and number of arguments
(c) names and data type
(d) number of argument and datatypes
17. Find the output of the following program.
void main()
{int x, f, fact(int);
x = 5;
f = fact (x);
printf (“%d”, f);
}fact (int m)
{int f =1;
if (m = = 1) return (1);
else
f = m * fact (m - 1);
return (f);
}
(a) 120
(b) 24
(c) 0
(d) 5
18. In the following C-statement, what is the datatype of d and st respectively.
Printf {“\t%.s\n”, d, st);
(a) digit, character
(b) digit, string
(c) character, string
(d) string, string
19. What happens when the declared register variables count exceeds the available number of processor registers.
(a) system hangs
(b) are treated as non register variables
(c) program halts
(d) it results register page faults
20. Which of the following is a correct way of defining a symbolic constant pie in C
(a) # Define pie 22/7
(b) #define pie 22/7
(c) # define pie = 22/7
(d) #define pie= 3.142
D D B D B D C B A A C A C D B D A B B B
1. The characters that are not displayed in the screen are referred as
(a) escape sequences
(b) control characters
(c) numeric characters
(d) Special characters
2. A machine language program consists of instructions written in
(a) 0’s and 1’s
(b) english like words
(c) keywords
(d) mnemonics
3. Which of the following is not a keyword
(a) constant
(b) signed
(c) typedef
(d) register
4. The keyword is used to define a new data type.
(a) array
(b) Structure
(c) union
(d) typedef
5. Which of the following statement is syntactically wrong
(a) int m;count;
(b) double p,x;
(c) double p=3.142,x;
(d) int x;
6. Addition of two numbers is performed using
(a) relational operators
(b) arithmetic operators
(c) logical operators
(d) conditional operators
7. Among the following operators, whose associatively is right to left
(a) logical operators
(b) bitwise operators
(c) conditional expression
(d) arithmetic operators
8. The symbol for right shift operator is
(a) <=
(b) − >
(c) >>
(d) >
9. What value would be stored in an integer variable “i” as a result of the following calculation:
int i,j; j=3; i=4+2 * j/(j-1);
(a) 6
(b) 7
(c) 1
(d) 8
10. Consider scanf(“%2d”, &n); and the input data is 3142 then what value is assigned to n
(a) 31.42
(b) 31
(c) 42
(d) error
11. The conditional operators “ ? :” is similar to
(a) nested if
(b) if-then-else
(c) while
(d) do-while
12. Which of the following statement causes an immediate exit from the inner most loop structure.
(a) kill
(b) stop
(c) break
(d) exit
13. The amount of storage required for holding elements of the array depends on
(a) run-time requirement
(b) data type
(c) datatype and size
(d) size
14. int table [2][3] ={{0}, {0}} in this statement
(a) none of the element are initialized to zero
(b) only first row elements are initialized to zero
(c) only last row elements are initialized to zero
(d) all the array elements are initialized to zero
15. Literal means
(a) A character
(b) A string
(c) A string constant
(d) An alphabet
16. The parameters in a function definition are
(a) actual parameters
(b) dummy parameters
(c) real parameters
(d) formal parameters
17. If the value of the formal argument is changed in the called function; the corresponding change in the calling
function, if it is call by value
(a) reflects
(b) does not reflects
(c) unpredictable
(d) machine dependent
18. In the following C-statement, what is the datatype of d and st respectively.
Printf {“\t%.s\n”, d, st);
(a) string, string
(b) character, string
(c) digit, string
(d) digit, character
19. If storage class is missing in the array definition , by default it will take to be
(a) automatic
(b) either automatic or external depending on the place of occurrence
(c) external
(d) static
20. Which of the following is a correct way of defining a symbolic constant pie in C
(a) # Define pie 22/7
(b) # define pie = 22/7
(c) #define pie 22/7
(d) #define pie= 3.142
A A A D A B C C B B B C C D C D B C B C

0 comments:

Copyright © 2008 - JNTU Online Bits - is proudly powered by Blogger
JNTU