CSC Technical-C Questions with answers |   23306

CSC Technical-C Questions with answers

 

CSC placement papers technical C questions with answers,CSC placement papers 

 

C / DATA STRUCTURES / DATA COMMUNICATION

1. How many times will the program print  “IndiaBIX”?
#include<stdio.h>
Int main()
{
Printf(‘IndiaBIX’);
Main();
Return 0;
}
A.    Infinite times   B. 32767 times
C.65535 times   D. Till stack doesn’t overflow.
 
2.       main(){
float f1=10.5;
double dbl = 10.5;
if(f1==dbl)
printf(“UNITED WE STAND”);
else
printf(“DIVIDE AND RULE”);
}
What is the output?
A.    Compilation Error.
B.    UNITED WE STAND.
C.    DIVIDE AND RULE.
D.    Linkage Error.
 
3.  EBCDIC code stands for
A.    Extended Binary Coded Decimal Interchange Code.
B.    Extended Biased Coding Decimal Interchange Code.
C.    External Biased Coding Decimal Interchange Code.
D.    None of the above.
 
4.  Typedef keyword is used for _______________
A.    Renaming an existing built-in or userdefined data type.
B.    Renaming a user defined data type only.
C.    Renaming an existing function name.
D.    Renaming built-in data type only.

5.  Binary search algorithm cannot be applied to
A.    Sorted Linked list.
B.    Sorted Binary Trees.
C.    Sorted linear arrays.
D.    Pointer Array.

6.       main(){
int i=300;
char*ptr=&1;
*++ptr=2;
Printf(“%d”,i);
}
What is the output?
A.    556  B. 300 C. 2 D. 302


7. A k-ary tree is a tree in which every node has atmost k children. In a k-ary tree   with n nodes and height h, which of the following is an upper bound for the    maximum number of leaves as a function of h,k and n?
(Here logk n is log base k n)
A.    Logk n
B.    Logk h
C.    n/logkn
D.    k h
17.   main(){
int I;
i= accumulator();
printf(“%d”,i);
}
Accumulator(){
_AX=1000;
}
What is the output?
A.    1
B.    10
C.    100
D.    1000

8.  What is the output?
Main(){
Char p[]=”HELLO”;
P[0]=’h’;
Printf(“%s\n”,p);
}
A.    hello
B.    HELLO
C.    Compiler error
D.    Runtime Error

9.  Identify the correct statement regarding the scope of variables
A.    Global variables that declared in a separate file and accessible from any program
B.    Local variables are declared inside a function and accessible within the function only
C.    Global variables are declared inside a function and accessible from anywhere in program
D.    Local variables are declared In the main body of the program and accessible only from functions

10.  In a binary tree , certain null entries are replaced by special pointer which point   to notes higher in the tree for efficiency. These special pointers are called

A.    Leaf B. Branch C. Path  D. Thread

11.. main ()
      {
      void swap();
      int x=45, y=15;
      swap(&x,&y);
      printf(“x=%d y=%d”, x,y);
       }
      void swap (int *a, int *b)
       {
       *a ^=*b, *b^=*a, *a^=b;
        }
What is the output?
A.    x = 15 y = 45
B.    x = 15 y = 15
C.    x = 45 y = 15
D.    x = 45 y = 45
 
12. What is the output of the following program?
         main ()
          {
          char *p=”hai friends”, *p1;
           p1 = p;
           while (*p!=’\0’) ++*p++;
           printf(“%s %s”, p, p1);
           }
A.    ibgsjfoet!j
B.    ibj!gsoetjf
C.    ibj!gsjftoe
D.    ibj!gsjfoet
 
13. Traverse the given tree using Preorder traversal.
   











A.    D H B E A F C I G J
B.    A B D H E C F G I J
C.    H D E B F I J G C A
D.    B C E D F G I J A D
 
14. Output of the following program is
         main()
         {
         int i = 0;
         for (i = 0;i<20;i++)
         {
         switch(i)
            case 0 : i+ = 5;
            case 1 : i+ = 2;
            case 5 : i+ = 5;
            default: i+ = 4;
            break;
            printf(“%d,”i);
          }
          }
A.    0,5,9,13,17
B.    5,9,13,17
C.    12,17,22
D.    16,21
 
15. Please chose correct output of the following program
        #include<stdio.h>
        Auto int a=5;
         int main()
          {
           int x;
           x=-a+a&a+a<<a;
           printf(“%d”,x);
           return 0;
           }
A.    0
B.    1
C.    155
D.    Compilation Error

16. C++ is similar to that of C in following ways
A.    C++ has classes
B.    Supports Inheritance
C.    File Handling
D.    None

17. The output of the below C code will be
       #include<stdio.h>
      int main()
 
{
Int a,b,c,d;
a=3;
b=5;
c=a,b;
d=(a,b);
print(“c=%d”,c);
printf(“d=%d”,d);
return 0;
}
A.    c=3 d=3
B.    c=3 d=5
C.    c=5 d=3
D.    c=5 d=5
 
18. Which of the following correctly copies the contents of string2 into string 1?  
       Assume that string 2 is equal to “hello” and string 1 is equal to “goodbye”
A.    strcat(string1, string2);
B.    strcat(string2, string1,7);
C.    strcat(string1, string2,6);
D.    strcat(string1, string2);

TOC / LP

19. The path of creation of an executable is:
 
A.    Coding, Linking, Compiling, Parsing.
B.    Coding,  Parsing, Compiling, Linking.
C.    Coding, Compiling, Parsing, Linking.
D.    Coding, Compiling, Linking, Parsing.

20.  Where is the Bootstrap loader present physically?
A.    HDD.
B.    BIOS RAM
C.    First track Zeroth Cylinder Zeroth Sector.
D.    Zeroth track Zeroth cylinder first sector

feedback