WorksheetsCode Chase Round-1
Total questions: 30
Worksheet time: 23mins
C language was developed by
Dennis Rechard
Dennis M. Ritchie
Bjarne Stroustrup
Anders Hejlsberg
What is the output of the following printf
printf("%d",34+24/12%3*5/2-4);
35
-2
34
38
What is the output of the following program?
#include<stdio.h>
main()
{
enum { india, is=7, GREAT };
printf("%d %d", india, GREAT);
}
0 1
0 2
0 8
Compile error
int main ()
{
int x = 24, y = 39, z = 45;
z = x + y;
y = z - y;
x = z - y;
printf ("%d %d %d", x, y, z);
}
24 39 63
39 24 63
24 39 45
39 24 45
The user can also write one or more statements in one line by separating semicolon (;)
True
False
Which of the following not relevant to AI?
It can perform only with a human intervention
It is for real time analytics and decision making
Reduce dependence on manual process
It is a simulation of human intelligence
Which of the following is not an IOT feature?
Things that collect and act with manual intervention only
Things that collect information & send it
Things that collect and act on it
Things that receive information & act on it
What is the full form of API?
Application programming interface
Application programming internet
Application programming interact
Application performing interface
How many bytes does "int = D" use?
0
1
2 or 4
8
A pointer is a memory address. Suppose the pointer variable has p address 1000, and that p is declared to have type int*, and an int is 4 bytes long. What address is represented by expression p + 2?
1002
1004
1008
1006
C language was invented to develop which Operating System?
Android
Linux
Ubuntu
Unix
C is _______ type of programming language ?
Object Oriented
Procedural
Bit level language
Functional
How many times will the following loop execute?
for(j = 1; j <= 10; j = j-1)
Forever
Never
0
1
Consider the following C declaration :
struct {
short s[5]
union{
float y;
long z;
}u;
}t;
Assuming that objects of the type short,float and long occupy 2 bytes,4 bytes and 8 bytes respectively. The memory requirement for variable t, ignoring alignmenmt considerations, is :
22 bytes
18 bytes
14 bytes
10 bytes
What is the output of the below code snippet?
#include<stdio.h>
main()
{
for(;;)printf("Hello");
}
A-Infinite loop
B - Prints “Hello” once.
C - No output
D - Compile error
Choose the correct program that round off x value (a float value) to an int value to return the output value 4,
A - float x = 3.6;
int y = (int)(x + 0.5);
printf ("Result = %d\n", y );
B - float x = 3.6;
int y = int(x + 0.5);
printf ("Result = %d\n", y );
C - float x = 3.6;
int y = (int)x + 0.5
printf ("Result = %d\n", y );
D - float x = 3.6;
int y = (int)((int)x + 0.5)
printf ("Result = %d\n", y );
What is the correct syntax to declare pointer to pointer i.e., double pointer?
type **pointer_name;
type *&pointer_name;
type *(*pointer_name);
type **(pointer_name);
In a C Program if
int a = 5;
Int *ptr = &a;
then the printf statement with
&a, a, *ptr , ptr
adrress, Value, Value, Adress
address, value, value, value
all address
All values
What will be output?
int i=10;
int *p;
p=&i;
i+=5;
printf("\n i=%d *p=%d", i,*p)
i=10, *p=10
i=10, *p=15
i=15, *p=15
i=15, *p=10
r+ mode in C file handling is for?
Reading files
Read and write files
append in file
read and append files
Structure is a variable which holds____________________
Different data types
similar data types
only int and float
only int and char
which of the following structure definition is correct one?
struct stu
{
----}s
struct stu
{
----}s;
struct stu
{
----};
both b and c
Which header file is mandatory for DYNAMIC MEMORY ALLOCATION
stdio.h
math.h
stdlib.h
dos.h
What is correct about calloc() function?
Allocates the space for elements of an ARRAY
initialize the elements to 0
If the space is insufficient then return NULL pointer
ALL of these
Memory allocation using malloc() is done in?
Static area
Heap area
Stack area
Both Stack & Heap area
Which one is used during memory deallocation in C?
free(p);
terminate(p);
delete(p);
remove(p);
Difference Between array and calloc()
array: Size is fixed
calloc () : fixed size
array: Size is fixed & static
calloc () : fixed size & dynamic
array: Size is fixed & dynamic
calloc () : fixed size & dynamic
array: Size is fixed & static
calloc () : fixed size can be altered & dynamic
How may arguments does relloc() takes?
2
1
3
