 ### C Programming

 Description: Test your C skill in programming language for campus placements by free online preparation and practice paper tests Number of Questions: 25 Created by: Tags: C PROGRAMMING Basics C Skills Advanced C Skills C Skills Test Java Skill Test DBMS Oracle PHP Computer Application Placement Papers MCA Entrance BCA BSC Computer Basics
Attempted 0/25 Correct 0 Score 0

Which of the following is not an identifier?

1. Area_of_circle

2. Pi-value

3. 4th semester

4. Count2

Correct Option: C

If i, j and k are integer variables with values 8, 15 and 4 respectively, the arithmetic expression 2 * ((i % 5) * (4 + (j - 3) / (k + 2))) results

1. 26

2. 36

3. 34

4. 32

Correct Option: B

Unsigned integer quantities are

1. greater than ordinary integer quantities

2. greater than ordinary integer quantities and can be negative

3. lesser than ordinary integer quantities and cannot be negative

4. greater than ordinary integer quantity and cannot be negative

Correct Option: D

The use of the function floor (d) returns the

1. value round down to the next integer value

2. absolute value of d

3. value round up to the next integer

4. none of these

Correct Option: A

What is the correct precedence of the following operators? !=, &&, *, >=

1. &&, *, >=, !=

2. *, >=, !=, &&

3. *, !=, &&, >=

4. >=, !=, &&, *

Correct Option: B

In the under given expression flag = (i < 10) ? 0 : 100 if the value of 'i' is 12, then the result is

1. 0

2. 10

3. 100

4. 12

Correct Option: C

Suppose a, b and c are integer variables assigned values 8, 3 and -5 respectively. In this case, the respective values of arithmetic expressions (a*c)%b and a*(c%b) are

1. -1 & 16

2. 1 & 16

3. 1 & -16

4. -1 & -16

Correct Option: D

If a C program contains the following declarations long ix; double dx; the data type of the expression ((int)dx) + ix is

1. double precision

2. double

3. long integer

4. integer

Correct Option: C

Is it possible to write the following expression? for(expression 1a, expression 1b; expression 2; expression 3) { statement; }

1. Yes

2. No

Correct Option: A

If the declaration is float x = 123.456, then the statement printf(“%7f %7.1f “,x,x) will print

1. 123.456000 & 123.5

2. 123.456 & 123.4

3. 123.4560000 & 123.5

4. 123.456000 & 123.0

Correct Option: A

For the statement 'scanf(“%3d %3d %3d”,&a,&b,&c)'; if the input value is 1234 5678 9, then the assignments will be

1. a=123 b=456 c=789

2. a=123 b=567 c=9

3. a=123 b=4 c=567

4. a=123 b=678 c=9

Correct Option: C

Break statement is used to terminate _____ loop(s).

1. for

2. while

3. do-while

4. all of the above

Correct Option: D

The syntax of the switch statement is switch (expression) statement is true when the expression results in

1. integer

2. char

3. float

4. either int or char

Correct Option: D

The function definition of the statement “A function called process accepts an integer and two floating point numbers and returns a double precision quantity”, is

1. float process( int i, float a, float b)

2. double process(int i, double a, double b);

3. double process (int i, float a, float b);

4. long process(int i, float a, float b);

Correct Option: C

Which of the following is a wrong declaration of array?

1. int digits={1,2,3,4,5};

2. float num;

3. char color={R,G,B};

4. static float x={2.5, 6.2, 7.8};

Correct Option: C

The strcmp function is used to __________.

1. compare three strings

2. compare two strings

3. copy strings

4. compare and then copy strings

Correct Option: B

The array declaration - float num - will have ____ elements.

1. 12

2. 17

3. 35

4. 60

Correct Option: D

The declaration char flag[]=”TRUE” will result in

1. flag is a one dimensional, 4 element, character array;

2. flag is a one dimensional, 5 element, character array;

3. flag is a one dimensional character array containing TRUE or FALSE

4. the declaration is wrong

Correct Option: B

Consider the following program segment: main() { int a=2; printf (“a= %d”,a); modify(a); printf (“a= %d”,a); } modify(a) { a*=3; printf (“a= %d”,a); return; } The answer printed after executing this program will be

1. a=2 a=2 a=2

2. a=2 a=6 a=2

3. a=2 a=6 a=6

4. none of these

Correct Option: B

The statement to declare a two dimensional floating point array of 15 rows and 30 columns using pointer, is

1. float *(15);

2. float ;

3. float *(x);

4. float *x;

Correct Option: C

The declaration int *px means that

1. p is a pointer to integer x

2. both p and x are pointers to integer quantity

3. px is an array of integer pointer

4. px is a pointer to an integer quantity

Correct Option: D

State whether the given statement is true or false.

1. True

2. False

Correct Option: B

The output of the following program is main() { int a, b, c; int num= {1,2,3,4,5,6,7,8,9,10,11,12}; for(a=0;a<3;++a) { c=999; for(b=0;b <4;++b) if (z[a][b]<c) c=z[a][b]; printf(“ %d”,c); } }

1. 1 5 9

2. 4 8 12

3. 1 4 7 10

4. 1 3 6 9 12

Correct Option: A

C pre-processor is a collection of special statements, called directives, which are executed _________.

1. as and when required

2. at the end of the compilation process

3. at the beginning of the compilation process

4. while running the program

Correct Option: C

A C program contains following declaration: char text; The for statement that permit a 60 character message and store it in array text is ________ text[i]=getchar();

1. for(i=0;i<80;++i)

2. for(i=0;i<=60;i++)

3. for(i=1;i<60;i++)

4. for(i=0;i<60;++i)

Correct Option: D
- Hide questions