Home »» Placement Papers »» All Papers »» CDAC »» Placement Paper

C-DAC Placement Questions - C programming paper


In the C-DAC technical test the student can expect C programming questions.

Here are a few questions asked in the technical section of the written test of C-DAC. The students are expected to select the correct alternative from the options given.

1. How can the Real constants in C be expressed? 

A. Fractional form only
B. Exponential form only
C. ASCII form only
D. Both Fractional and Exponential forms 

2. What is the program called which translates high-level program into its equivalent machine language program? 

A.Transformer
B. Language processor
C. Converter
D. None of these options

3. Find the output of the following code? 

#include
void main()
{
int arr[2][3][2]={{{2,4},{7,8},{3,4},}, {{2,2},{2,3},{3,4}, }}; printf("n%d",**(*arr+1)+2+7);
}

A. 14 
B. 16
C. 1
D. Error

4. What is the correct hierarchy of arithmetic operations in C from the following?

A.(), / or *, - or + 
B.(), **, * or /, + or -
C.(), **, *, /, +, -
D.(), **, /, *, +, -

5. In the following code, what will be the value of variable?

unsigned char a;
a = 0xFF + 1;
printf("%d", a);

A. 0xFF
B. 0x100
C. 0 
D. 0x0 

6. Find the output of the following code? 

#include
main()
{
register int a=2;
printf("nAddress of a = %d,", &a); printf("tValue of a = %d",a); 

A. Address of a,2 <------ans
B. Linker error
C. Compile time error
D. None of these options 

7. Find the output of the following code?

#include
void main()
{
int a=14;
a += 7;
a -= 5;
a *= 7;
printf("n%d",a);
}

A.98
B. 112
C. 89
D. None of these options 

8. Find the output of the following code?

#include 
void main()
{
printf("n10!=9 : %5d",10!=9);
}

A. 1 
B. 0
C. Error
D. None of these options

9. Find the output of the following code?

#include
void main()
{
int x=10;
(x<0)?(int a =100):(int a =1000);
printf(" %d",a);
}

A. Error
B. 1000
C. 100
D. None of these options

10. Which of the following statement is true about recursive function

i. it is also called circular definition
ii. it occurs when a function calls another function more than once
iii. it occurs when a statement within the function calls the function itself 
iv. a recursive function cannot have a return statement within it"

A. i and iii
B. i and ii
C. ii and iv
D. i, iii and iv

11. Find the output of the following program code?

#include
void abc(int a[])
{
a++;
a[1]=612;
}
main()
{
char a[5];
abc(a);
printf("%d",a[4]);
}

A. 1000
B. 6500
C. Error 
D. 7500

12. What will be the outcome if you assign a value to an element of an array whose subscript exceeds the size of the array?

A. Nothing, it’s done all the time
B. The element will be set to 0
C. Other data may be overwritten
D. Error message from the compiler 

13. From the following is the feature of stack?

A. Any element can be accessed from it directly 
B. All operations are at one end
C. It cannot reuse its memory
D. All elements are of different data types

14. The stacks are created when:

A. Are initialized to zero
B. Are initially empty
C. Are considered full
D. None of these options 

15. The queues are created when:

A. Are initially empty
B. Are initialized to zero
C. Are considered full
D. None of the above

Comment

0 Answers