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
Questions
If a static array is not initialised, its elements will be set at
- 0
- an undetermined value
- floating point number
- the character constant '-'
The maximum value that an integer constant can have is
- 32767
- � 32767
- 1.7014e+38
- �1.7014e+38
Give the output of the following program:
main( )
{
int a=30,b=40,x;
x=((a!=10) && (b=50))
printf(“x=%d”,x)'
}
- x = 1
- x = 0
- no output
- none of these
The format specifier used for long unsigned is
- %u
- %ud
- %lu
- %l
If a character string is to be received through keyboard, which function would work faster?
- getch( );
- gets( );
- getchar( );
- getche( );
The output of: 13% - 3 will be
- � 1
- + 1
- + 4
- � 4
The format string of printf() function can contain
- character, conversion specifications and escape sequences
- character, integers and floats
- strings, integers and escape sequences
- none of these
int num[ ] = {24,32,12,44,56,17}, *(num +4) refers to
- 56
- 44
- 17
- none of these
int num[ ] = {24,32,12,44,56,17}, *(num +0) refers to
- 12
- 32
- 24
- none of these
The declaration 'char *ch' means
- ch contains the address of char variable
- ch is a char variable
- ch is going to contain a char value
- none of these
To receive the string “we are going” in an array char str[100], which of the following functions would you use?
- scanf(“%s”,str);
- gets(str);
- getche(str);
- fgetchar(str);
The value of 15/10.0 is
- 0.5
- 1.5
- 0
- none of the above
int i;
int *j;
int **k;
In the above declaration, 'k' is a
- pointer to a variable
- pointer variable
- pointer to an int pointer
- none of these
num[i] is same as
- *(num+i)
- *num+I
- *i+num
- none of these
The Range of Short signed integer is
- � 128 to + 127
- 0 to 255
- 0 to 65535
- � 32768 to + 32767
The minimum number of temporary variables needed to swap the contents of two variables, is
- 1
- 2
- 3
- 0
The output of expression 9-12/(3 + 3)*(2 - 1), is
- 7
- 5
- 0
- none of the above
Which of the following is the correct way of declaring a float pointer?
- float ptr
- float *ptr
- *float ptr
- none of these
If int s[5] is a one dimensional array of integers, which of the following refers to the 3rd element in the array?
- *(s+2)
- *(s+3)
- s+3
- s+2
*operator used in pointer notation stands for
- address of operator
- value at address
- address of a variable
- none of these
A pointer enables us to access a variable that is defined
- inside the function
- outside the function
- within the function
- none of these
Which function would you use if a single key is to be received through the keyboard?
- puts( );
- gets( );
- getchar( );
- none of these
In the declaration float, *s mean that
- 's' is a float variable
- 's' is going to contain a floating point value
- 's' contains the address of a floating point variable
- none of these
main()
{
int i=3;
printf(Value of i=%d,*(&i));
}
Give the output of above program.
- Value of i=6485
- Value of i=3000
- Value of i=3
- None of these
If an integer is to be entered through keyboard, which function you would use?
- scanf( )
- gets( );
- getchar( );
- getche( );