C Programming

Get complete study material to prepare for any Entrance, Test Papers to check the basic programming skills using C covers all concepts like arrays, loops, conditions, file Handling in C, polymorphism, functions, data structure

25 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

If a static array is not initialised, its elements will be set at

  1. 0
  2. an undetermined value
  3. floating point number
  4. the character constant '-'
Question 2 Multiple Choice (Single Answer)

The maximum value that an integer constant can have is

  1. 32767
  2. � 32767
  3. 1.7014e+38
  4. �1.7014e+38
Question 3 Multiple Choice (Single Answer)

Give the output of the following program:
main( )
{
int a=30,b=40,x;
x=((a!=10) && (b=50))
printf(“x=%d”,x)'
}

  1. x = 1
  2. x = 0
  3. no output
  4. none of these
Question 4 Multiple Choice (Single Answer)

The format specifier used for long unsigned is

  1. %u
  2. %ud
  3. %lu
  4. %l
Question 5 Multiple Choice (Single Answer)

If a character string is to be received through keyboard, which function would work faster?

  1. getch( );
  2. gets( );
  3. getchar( );
  4. getche( );
Question 6 Multiple Choice (Single Answer)

The output of: 13% - 3 will be

  1. � 1
  2. + 1
  3. + 4
  4. � 4
Question 7 Multiple Choice (Single Answer)

The format string of printf() function can contain

  1. character, conversion specifications and escape sequences
  2. character, integers and floats
  3. strings, integers and escape sequences
  4. none of these
Question 8 Multiple Choice (Single Answer)

int num[ ] = {24,32,12,44,56,17}, *(num +4) refers to

  1. 56
  2. 44
  3. 17
  4. none of these
Question 9 Multiple Choice (Single Answer)

int num[ ] = {24,32,12,44,56,17}, *(num +0) refers to

  1. 12
  2. 32
  3. 24
  4. none of these
Question 10 Multiple Choice (Single Answer)

The declaration 'char *ch' means

  1. ch contains the address of char variable
  2. ch is a char variable
  3. ch is going to contain a char value
  4. none of these
Question 11 Multiple Choice (Single Answer)

To receive the string “we are going” in an array char str[100], which of the following functions would you use?

  1. scanf(“%s”,str);
  2. gets(str);
  3. getche(str);
  4. fgetchar(str);
Question 12 Multiple Choice (Single Answer)

The value of 15/10.0 is

  1. 0.5
  2. 1.5
  3. 0
  4. none of the above
Question 13 Multiple Choice (Single Answer)

int i;
int *j;
int **k;
In the above declaration, 'k' is a

  1. pointer to a variable
  2. pointer variable
  3. pointer to an int pointer
  4. none of these
Question 14 Multiple Choice (Single Answer)

num[i] is same as

  1. *(num+i)
  2. *num+I
  3. *i+num
  4. none of these
Question 15 Multiple Choice (Single Answer)

The Range of Short signed integer is

  1. � 128 to + 127
  2. 0 to 255
  3. 0 to 65535
  4. � 32768 to + 32767
Question 16 Multiple Choice (Single Answer)

The minimum number of temporary variables needed to swap the contents of two variables, is

  1. 1
  2. 2
  3. 3
  4. 0
Question 17 Multiple Choice (Single Answer)

The output of expression 9-12/(3 + 3)*(2 - 1), is

  1. 7
  2. 5
  3. 0
  4. none of the above
Question 18 Multiple Choice (Single Answer)

Which of the following is the correct way of declaring a float pointer?

  1. float ptr
  2. float *ptr
  3. *float ptr
  4. none of these
Question 19 Multiple Choice (Single Answer)

If int s[5] is a one dimensional array of integers, which of the following refers to the 3rd element in the array?

  1. *(s+2)
  2. *(s+3)
  3. s+3
  4. s+2
Question 20 Multiple Choice (Single Answer)

*operator used in pointer notation stands for

  1. address of operator
  2. value at address
  3. address of a variable
  4. none of these
Question 21 Multiple Choice (Single Answer)

A pointer enables us to access a variable that is defined

  1. inside the function
  2. outside the function
  3. within the function
  4. none of these
Question 22 Multiple Choice (Single Answer)

Which function would you use if a single key is to be received through the keyboard?

  1. puts( );
  2. gets( );
  3. getchar( );
  4. none of these
Question 23 Multiple Choice (Single Answer)

In the declaration float, *s mean that

  1. 's' is a float variable
  2. 's' is going to contain a floating point value
  3. 's' contains the address of a floating point variable
  4. none of these
Question 24 Multiple Choice (Single Answer)

main()
{
int i=3;
printf(Value of i=%d,*(&i));
}
Give the output of above program.

  1. Value of i=6485
  2. Value of i=3000
  3. Value of i=3
  4. None of these
Question 25 Multiple Choice (Single Answer)

If an integer is to be entered through keyboard, which function you would use?

  1. scanf( )
  2. gets( );
  3. getchar( );
  4. getche( );