0
Alien head

C Programming Language Quiz - 1

Description: C Programming Language Quiz - 1
Number of Questions: 10
Created by:
Tags: c

if ( 16 = m ) printf("m is 16");

c
  1. is correct

  2. has syntax error

  3. causes run-time error

  4. none of the above

Answer: 2

To copy a string into another, given:
char s1[30] = "xyz", s2[20];

c
  1. s2 = s1;

  2. strcpy(s2,s1);

  3. s2 == s1;

  4. all three are wrong

Answer: 2

If LSB of a binary number is "0" then it is:



      
c
  1. Positive number

  2. Even number

  3. Odd number

  4. Prime number

Answer: 1

consider the following statement:

while ( 1 ) ;
c
  1. Infinite loop

  2. Syntax error

  3. Depends on the compiler

  4. none of the above

Answer: 1

What is the output of the following piece of code?

int x = 3, y = 5, z;
z = x + ++y;

printf(“%d”,z);
c
  1. 8

  2. 9

  3. 10

  4. 11

Answer: 2

The highest digit in any number system equals:



      
c
  1. Zero

  2. Base - 1

  3. Base 1

  4. none of the above

Answer: 2

The main() function is:



      
c
  1. to write output to the screen

  2. the program entry point

  3. Both correct

  4. Both wrong

Answer: 2

To get a statement from the user input in the array char s[100]:



      
c
  1. gets( s[100] );

  2. gets( s[] );

  3. gets( s );

  4. none of the above

Answer: 3

what is the output of the following program

int change( int x ) {
 x = 7;
}

main(){
 int x = 5;
 change(x);
 printf(“%d”,x);    
}
c
  1. 5

  2. 7

  3. 9

  4. unknown

Answer: 1

What is the output of the following piece of code:

int x = 7;
if ( x = 3 ) printf( “%d“ , x);
c
  1. no output

  2. 7

  3. 3

  4. 5

Answer: 3
+ View questions