cds online bits

1. Pictorial representation of an algorithms is known as
(a) picture
(b) Flowchart
(c) Diagram
(d) Graphchart
2. In C, comments are placed between
(a) *...... /*
(b) *.....*
(c) /*......*/
(d) //
3. Which of the following cannot be used as an identifier.
(a) Keywords
(b) alphabet
(c) Library function name
(d) alphabet followed by digit
4. Float data type variable occupies bytes in memory
(a) 8
(b) 1
(c) 2
(d) 4
5. In C every variable has
(a) a type and size
(b) a type, name, value and size
(c) a name and type
(d) a size and value
6. The result of 5/2.0 is?
(a) 2.5
(b) 3
(c) 2
(d) 2.49
7. Which is used in ‘C’ to indicate logical AND
(a) ^
(b) &
(c) and
(d) &&
8. Among the following operators which operators has the highest priority
(a) Logical AND
(b) Bitwise OR
(c) Logical OR
(d) Bitwise XOR
9. Compute the result of the following expression in ‘C’. A=3*4/5+10/5+8-1+7/8
(a) 11
(b) 10
(c) 12
(d) 9
10. How would you copy the name “Hello” to a character array (i.e. string) declared as char str[10];
(a) strcpy( str, “Hello” );
(b) strcat(str,“Hello”);
(c) printf( str, “Hello” );
(d) str = “Hello”;
11. Which of the following statement is not true about the switch statement
(a) Character constants are automatically converted into integer
(b) No two case statements have identical constants in the same switch
(c) In switch() case statement nested if can be used
(d) The switch() can evaluate relational or logical expressions
12. count=0;
for ( I=0;I<=10; I++)
{if(I%2==0)
count++;
}printf(“%d”, count);
Pick out the correct value for count.
(a) 6
(b) 3
(c) 4
(d) 5
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) Last element data may be overwritten
(d) Nothing
14. consider the array definition
int num [10] = { 3 ,3 ,3 };
pick the correct answers
(a) the value of num[8] is 3
(b) this is invalid if it comes within a function
(c) This is syntactically wrong
(d) the value of num[2] is 3
15. The following function is used to count and return the number of characters in a given string
(a) strlen()
(b) strcat()
(c) strrev()
(d) strcmp()
16. The default return type of a function is
(a) character
(b) float
(c) double
(d) Integer
17. When both called function and calling function are same, then the process is said to be
(a) synchronization
(b) modularity
(c) recursion
(d) Concurrency
18. The function is used to find the length of the string
(a) strrsa()
(b) strrev()
(c) strcat()
(d) strlen()
19. Which of the following is not a storage class
(a) register
(b) external
(c) define
(d) automatic
20. The function sqrt() is part of header file.
(a) iostream.h
(b) stdio.h
(c) conio.h
(d) math.h

B C A D B A D D A A B A A D A D C D C D
1. Pseudo code is
(a) language independent code
(b) code developed using the syntax of a specific language
(c) refined version of program
(d) outcome of compilation process
2. The escape sequence ‘\t0 is a
(a) next column
(b) Tab
(c) Backspace
(d) Nextline
3. In the following which one is not a C keyword?
(a) case
(b) for
(c) volatile
(d) choice
4. To convert a value of one data type to another data type in an expression which of the following is used
(a) casting
(b) user defined types
(c) automactic conversion
(d) type define
5. Which of the following is the assignment operator in C
(a) : =
(b) =
(c) !=
(d) = =
6. Which of the following is shorthand operator for a=a%b
(a) a =%b
(b) a % b
(c) a%=b
(d) a%b=a
7. Which of the following is used in ‘C’ to indicate logical OR
(a) V
(b) U
(c) ||
(d) |
8. The symbol for right shift operator is
(a) <=
(b) >>
(c) >
(d) − >
9. Which of the following arithmetic expression is invalid
(a) 7.5 % 3
(b) 2 + 3/5
(c) 9% -3
(d) -9%3
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) ch = getch( );
(b) printf( “%c”, ch );
(c) while(!kbhit)
(d) getkeyb ( ch );
11. The switch statement is used to
(a) manipulate switching variables
(b) switch from one variable to other
(c) choose from multiple possibilities
(d) switch between functions in a program
12. What is the output of the following module
sum=0; I=0;
do{ sum+=I;
I++;
}while(I<=5);
printf(“%d”, sum);
(a) 28
(b) 10
(c) 15
(d) 21
13. The value within the [] brackets in an array declaration specifies
(a) value of the array element
(b) subscript value
(c) address value
(d) size of an 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. main()
{char name[5];
scanf(“%s”,name);
printf(“%s”, name);
}if Program is the given as input, what will be the o/p of the program;
(a) Progr
(b) Prog
(c) program
(d) Runtime error
16. Any function can be called from any other function. This statement is
(a) true some tines
(b) neither true nor false
(c) false
(d) true
17. Which of the following statements is correct when an array is passed to a called function
(a) function-name ( array-name [ ] )
(b) not possible
(c) function-name ( array-name , size )
(d) function-name ( array-name[size])
18. To find the second string in the first string which of the following string handling functions is used.
(a) str in str()
(b) strstr()
(c) str lwr()
(d) str substr()
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) complier dependent
(b) external variable
(c) auto variable
(d) depends on logic
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= 3.142
(c) # define pie = 22/7
(d) # Define pie 22/7

A B D A B C C B A A C C D D B D C B C A
1. Pictorial representation of an algorithms is known as
(a) picture
(b) Flowchart
(c) Diagram
(d) Graphchart
2. Which function returns single character
(a) scanf
(b) putchar
(c) getchar
(d) printf
3. How many keywords are there in C
(a) 32
(b) 31
(c) 30
(d) 34
4. A short integer occupies normally of memory
(a) three bytes
(b) four bytes
(c) two bytes
(d) single bytes
5. Array elements are stored in
(a) Scattered memory locations
(b) Sequential memory locations
(c) Direct memory locations
(d) Random memory location
6. Which of the following is shorthand operator for a=a%b
(a) a%=b
(b) a =%b
(c) a % b
(d) a%b=a
7. Among the following operators, whose associatively is right to left
(a) bitwise operators
(b) conditional expression
(c) arithmetic operators
(d) logical operators
8. What is the value of the following expression when a=10,b=5
x = b+++a;
(a) 15
(b) error
(c) 17
(d) 16
9. The expression a = 7/22 * (3.14+2) * 3/5 ; evaluates to which value if a is a float type variable
(a) 8.28
(b) 0.00
(c) 6.28
(d) 3.14
10. Consider scanf(“%2d”, &n); and the input data is 3142 then n will be assigned
(a) 31.42
(b) 42
(c) 31
(d) error
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==10) {; } else if (a<10) {; }
(d) if (a.eq. 10) {; } else if (a<10) {; }
12. Do-while loop is also called as
(a) prefix tested
(b) infix tested
(c) pre-tested
(d) post tested
13. Array elements are stored in
(a) column major order
(b) in diagonal order
(c) row major order
(d) either in row major or column major order
14. Under which of the following conditions,the size of the array need not be specified?
(a) when the compiler is smart
(b) when it is a formal parameter
(c) when initialization is a part of definition
(d) when it is a declaration
15. Find the output of the following program
main()
{ char name1 [4] = ‘R’, ‘A’, ‘V’, ‘I’;
char name2 [5] = ‘R’,‘A’,‘V’,‘I’;
printf (“%s”, name1);
printf (“%s”, name 2);
}
(a) RAVI RAVI
(b) RAVI garbage value
RAVI
(c) RAVI
garbage value
(d) Garbage value
RAVI
16. Which of the following is TRUE
A Function
(a) returns only vector values
(b) returns only scalar values
(c) returns both scalar and vector values
(d) returns any number of values
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) 100, 10
(d) 10, 100
18. If s1=“abc” s2=“def” s3=“ghi” then the returned value of strcat(strcat(s1,s2),s3) is
(a) abcghi
(b) ghidefabe
(c) abcdefghi
(d) abcdef
19. External variables are declared
(a) in any function, with a profix key word “external”
(b) in first level user defined functions
(c) in main() function
(d) outside the function body
20. #include is a directive
(a) processor
(b) pre-compiler
(c) pre-processor
(d) complier

B C A C B A B A B C C D D C B C D C D C
1. The process of repeating a group of statements in an algorithm is known as
(a) flow
(b) selection
(c) sequence
(d) iteration
2. Which keyword is used for is normal exit from a function.
(a) close
(b) eof (0)
(c) exit
(d) return
3. Which of the following is not a key word of C?
(a) const
(b) main
(c) void
(d) sizeof
4. Which of the following is a scalar data type used in ‘C’
(a) union
(b) array
(c) structure
(d) double
5. The purpose of the following fragment
B=S+B
S=B-S;
B=B-S;
Where S,B are two integers is to
(a) swap the contents of S and B
(b) transfer the contents of S to B
(c) transfer the contents of B to S
(d) negate the contents of S and B
6. Output of printf(“%f”,3/4) is———
(a) 0.00
(b) gives an error
(c) 0.75
(d) 0
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 = 1
(c) p =0 q = 0
(d) p = 1 q = 1
8. Among the following operators which operators has the highest priority
(a) Bitwise XOR
(b) Bitwise OR
(c) Logical OR
(d) Logical AND
9. x=9-12/3+3*2-1, what is the value of x
(a) 2
(b) 4
(c) -10
(d) 10
10. Which of the following statements is used to read a string of characters into the array words.
(a) scanf(“%d”, words);
(b) scanf(”% s\n”, words);
(c) scanf(“%s”, words);
(d) scanf(“ %c”, words);
11. If statement is a —————statement
(a) one-way decision
(b) multiway decision
(c) two way decision
(d) loop construct
12. Break statement in a loop is used for
(a) terminating the loop
(b) de-allocating memory
(c) terminating the program
(d) terminating the function
13. Array elements are stored in
(a) scattered memory locations
(b) sequential memory locations
(c) direct memory locations
(d) indirect memory locations
14. Dynamic memory allocation in array results in
(a) allocation of memory at runtime
(b) allocation of memory at debugging time
(c) allocation of memory at compile time
(d) allocation of memory at file saving time
15. A string constant is one dimensional array of charecters terminated by a
(a) comma
(b) fullstop
(c) semicolan
(d) null character (‘\00)
16. main() is
(a) friendly function
(b) member function
(c) library function
(d) user defined function
17. When a function is recursively called, all automatic variables are
(a) stored in a list
(b) stored in a stack
(c) stored in an array
(d) stored in queue
18. A function strcat() will take
(a) 3 arguments
(b) 2 arguments
(c) zero arguments
(d) 1 argument
19. Which of the following statement is wrong with respect to a storage class
(a) by defualt a storage class is static
(b) it specifies the defualt initial value
(c) if specifies where variable is stored
(d) it specifies the life of a variable
20. The header file that must be included at the beginning of a C program to use a library function cos is
(a) stdlib.h
(b) conio.h
(c) dos.h
(d) math.h

D D B D A A D A D C C A B A D D B B A D
1. The process of repeating a group of statements in an algorithm is known as
(a) flow
(b) selection
(c) sequence
(d) iteration
2. Which function returns single character
(a) putchar
(b) scanf
(c) printf
(d) getchar
3. Which of the following is not a keyword
(a) register
(b) enum
(c) storage
(d) signed
4. The size of all the below datatypes is identical except the one. Identify the odd one
(a) unsigned long
(b) double
(c) long
(d) float
5. The minimum number of temporary variable needed to swap the contents of two variable is
(a) 2
(b) 1
(c) 0
(d) 3
6. The value of the following expression a++ + a if the variable a has a initial value of 5 is
(a) 10
(b) 12
(c) 11
(d) 9
7. In an expression involving ||
||
operator the evaluation
(a) will be stopped if one of its components evaluates to true
(b) takes place from right to left
(c) will be stopped if one of its components evaluates to false
(d) takes place from left to right
8. main( )
{int m=7,y;
y=m++;
printf(“y=%dm=%d”,y,m);
y=–m;
printf(“y=%dm=%d”,y,m);
}output is———–
(a) y=7,m=8,y=6,m=7
(b) y=7,m=8,y=6,m=6
(c) y=7,m=8,y=7,m=7
(d) y=7,m=7,y=6,m=6
9. Compute the result of the following expression in ‘C’. A=3*4/5+10/5+8-1+7/8
(a) 12
(b) 11
(c) 10
(d) 9
10. The single character input/output functions are
(a) getchar and printf
(b) scanf and printf
(c) scanf and putchar
(d) getchar and putchar
11. The keyword ‘else” can be used with
(a) for statement
(b) do.. while ( ) statement
(c) if statement
(d) switch ( ) statement
12. The while loop is terminated when the conditional expression returns
(a) 1
(b) 2
(c) 3
(d) zero
13. All the elements in the array must be
(a) initialized and defined
(b) neither initialized nor defined
(c) defined
(d) initialized
14. If we don’t initialize a static array, what will be the elements set to:
(a) character constant
(b) 0
(c) an undetermined value
(d) a floating point number
15. The NULL character \0 in a string indicates
(a) the end of string
(b) invalid string
(c) the beginning of string
(d) the middle of string
16. int cal sum(int a, int b);
In the above, int at the beginning indicates
(a) name of function
(b) return type of function
(c) both function arguments are integer
(d) received type of function
17. Arrays are passed as arguments to a function by
(a) context
(b) value
(c) reference
(d) both value and reference
18. What will be the output of the following program
#include
main()
{int x;
x=‘d‘ *5 + 20;
printf(“%d”,x);
}
(a) runtime error
(b) 520
(c) compile time error
(d) 20
19. If you don’t initialize a static array, what will be the elements set to
(a) 0
(b) the character constant ‘ΓΈ’
(c) a floating point number
(d) an undetermined value
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
D D C B C C A C B D C D C B A B C B A 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. 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 cannot be used as an identifier.
(a) alphabet followed by digit
(b) Library function name
(c) alphabet
(d) Keywords
4. A short integer occupies normally of memory
(a) three bytes
(b) four bytes
(c) single bytes
(d) two bytes
5. In the following, which is not valid character constant ?
(a) “#”
(b) ‘B’
(c) ‘2’
(d) ‘#’
6. Which of the following statements will subtract a value of 2 from the variable ‘i’?
(a) i+=-2;
(b) i= -2;
(c) i–;
(d) i- = 2;
7. Identify the logical operator from the following:
(a) !
(b) _
(c) = =
(d) !=
8. In the following, which is bitwise operator?
(a) *
(b) >
(c) <
(d) |
9. Which of the following arithmetic expression is invalid
(a) -9%3
(b) 7.5 % 3
(c) 2 + 3/5
(d) 9% -3
10. What is the output for the following program
main( )
{ int m=5,y;
y=++m;
printf(“%d,%d”m,y);
}
(a) 7,5
(b) 5,6
(c) 6,6
(d) 5,5
11. Identify the wrong statement:
(a) if (a(b) if (a(c) if a(d) if (a >b) {; ; }
12. Which of the following statements is false
(a) The expression in the condition part of a for statement can be empty
(b) The initialization and increment parts of a for statement can be empty
(c) The body of do-while statement can be empty
(d) The initialization part of a for statement cannot have more than one initialization
13. One dimensional array is known as
(a) matrix
(b) vector
(c) set
(d) table
14. Under which of the following conditions,the size of the array need not be specified?
(a) when initialization is a part of definition
(b) when the compiler is smart
(c) when it is a declaration
(d) when it is a formal parameter
15. What is the input function for reading a strings
(a) getche()
(b) getch()
(c) gets()
(d) getchar()
16. A function can return only value
(a) three
(b) zero
(c) one
(d) two
17. How many instance auto variable (f) are created in the execution of the following program. if m = 5.
fact(m)
{int f = 1;
if (m = = 1) return(1);
else
f = m * fact (m-1);
return(f);}
(a) 6
(b) 5
(c) 4
(d) 1
18. Consider the following program
main()
{ char str[10]; scanf(“%s”,str); printf(“%s”,str); } The error in the above program is
(a) memery has not been allocated for the variable str
(b) the parameter str to scanf is passed by value, it should be a address
(c) the format control for the string variable is not %s
(d) no error in the program
19. External variables are active
(a) only within the function where it is declared using the qualifier extern
(b) throughout the program
(c) only within some functions
(d) only with in main functions and functions with in main functions
20. Which of the following is a correct way of defining a symbolic constant pie in C
(a) #define pie= 3.142
(b) # Define pie 22/7
(c) # define pie = 22/7
(d) #define pie 22/7
D D D D A D A D B C C D B A C C C D B D
1. Representing various steps in a flow diagram is called as
(a) program
(b) paint
(c) flow chart
(d) diagram
2. The escape sequence ‘\t0 is a
(a) next column
(b) Nextline
(c) Tab
(d) Backspace
3. The only allowed special character in a variable name is
(a) ;
(b) (under scrore)
(c) ,
(d) :
4. Which data type is used to represent string literals
(a) Character
(b) Integer
(c) Void
(d) Float
5. The real constant in C can be expressed in which of the following forms
(a) fractions form only
(b) both fractional and Exponential
(c) exponential form only
(d) ASCII form only
6. Number of binary arithmetic operators in C is:
(a) 4
(b) 7
(c) 6
(d) 5
7. Which is used in ‘C’ to indicate logical AND
(a) &
(b) ^
(c) and
(d) &&
8. int x=1,y=5;
x=++x + –y;
what is the value of x
(a) 7
(b) 8
(c) 6
(d) 5
9. int C;
C=25/2; What is the value of C
(a) 12.000000
(b) 12
(c) 12.500000
(d) 0.5
10. The output of the statement printf(“%d”,0xDC ) is
(a) 420
(b) 320
(c) 120
(d) 220
11. Which of the following statement is not true about the switch statement
(a) Character constants are automatically converted into integer
(b) No two case statements have identical constants in the same switch
(c) The switch() can evaluate relational or logical expressions
(d) In switch() case statement nested if can be used
12. Which of the following is not correct
(a) while loop is executed only if the condition is true
(b) do . while loop is executed at least once
(c) while loop is executed atleast once
(d) dowhile loop is ececuted only if the condition is true
13. Output of the below program
#include
main()
{int a,b=0;
int c[10]={1,2,3,4,5,6,7,8,9,0 };
for(a=0;a<10;++a)
b+=c[a];
printf(“%d”,b);
}
(a) 0
(b) 55
(c) 45
(d) 1 3 6 10 15 21 28 32 45 45
14. The maximum number of dimension an array can have in C language is
(a) compiler dependent
(b) 4
(c) 5
(d) 3
15. A character array is terminated internally with
(a) (space)
(b) ‘\0’
(c) 0
(d) ;
16. Find the C library function from the following
(a) brazil()
(b) main()
(c) printf()
(d) mul()
17. ‘C’ language by default allows
(a) call by name
(b) call by pointer
(c) call by value
(d) call by reference
18. What is the use of strcmp( ) function
(a) string concatenation
(b) finds the length of the string
(c) string comparison
(d) copies one string into another
19. Variables declared using the register storage class are created in
(a) hard disk
(b) ROM
(c) processor registers
(d) RAM
20. Symbolic constants are defined as
(a) #define s1 s2
(b) #define s1=s2;
(c) #define s1 s2;
(d) #define s1=s2

C C B A B D D C B D B C C A B C C C C A

0 comments:

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