Programming, Data Structure & Algorithm - 1
Programming, Data Structure & Algorithm - 1
Questions
The statement which makes a while loop to skip statements in the current iteration and goes straight to while condition checking.
- Break
- Continue
- Skip
- None
Find out odd one out of the following statements assuming an integer variable, a, whose value is already initialised to 10.
- printf(“%d ”, a)
- printf(“%d ”, *&a)
- printf(“%d ”, &&&&&&a)
- printf(“%d ”, &&&&&*&a)
Find the odd one out of the following.
- int i = 0; while(i < 5){ i++;}
- int i = 1; while(i < = 5){ i++;}
- int i = 5; while(i--);
- int i = 5; while(--i);
Assume that we want to exchange values of two unsigned character type variable values. Only one operator is permitted to be used. What will be it?
- +
- –
- <<
- ^
First argument in sprint is
- an integer
- a string variable
- a float
- none of the above
C language uses _____ characters.
- ASCII
- ISCII
- UNICODE
- EBCDIC
What is the output of the following code fragment?
int i = 0, j = 3;
while(i++<5|| j--) printf(“Hi”);
- HiHiHiHiHiHiHiHi
- Hi
- HiHiHi
- HiHiHiHiHi
Dangling memory is the
- memory which is allocated using dangling function instead of malloc
- memory which is allocated and freed in the same block
- memory which is allocated in a function and control returns from the function with its starting address such that this memory is accessed outside
- memory which is allocated in our account but we don’t have freedom to use the same
If a is a valid 2-D character array, then 0[a] refers to
- invalid
- first row of the 2-D character array
- first row first element of the 2-D character array
- none of the above
What is the output of the following code fragment?
int i = 10;
if(i = printf(“%d”, i))
{
printf(“%d ”, i);
}
- 10
- 0
- 102
- 2
Dangling memory is the
- memory which is allocated using dangling function instead of malloc
- memory which is allocated and freed in the same block
- memory which is allocated in a function and control returns from the function with its starting address such that this memory is accessed outside
- memory which is allocated in our account but we don’t have freedom to use the same
A variable becomes pointer type if
- we use * before it in its declaration
- we use ** before it in its declaration
- we use *** before it in its declaration
- all of the above
Find the odd one with respect to:
- printf
- main
- scanf
- #define
What is the result of the following program?
int a[2][2][2] = { 10, 2, 3, 4, 5, 6, 7, 8 };
printf("%d",***a);
- Error
- 10
- Address of the array
- None
The scanf function returns
- integer
- number of values which it reads
- both the above
- none of the above