NEW
Font size
WorksheetsTCS Preparation
Total questions: 10
Worksheet time: 10mins
In C language, if a function return type is not explicitly defined then it defaults to what data type?
int
char
float
void
realloc() function is used to
Get back the memory that was released earlier usingdree() function
Reallocate a file pointer when switching between files
Change the size of an array
Change the size of the dynamically allocated memory
Which of the below is NOT a data type in C language:
signed int
big int
short int
long int
Which of the following is NOT a valid storage class in C language?
Extern
Dynamic
Register
Auto
Eesha wrote a function fact( ) in "C" language to calculate factorial of a given number and saved the file as fact.c. She forgot to code the main function to call this fact function. Will she be able to compile this fact.c without the main() function?
Yes, she can compile provided the compiler option -no strict-checking is enabled.
No, she can not compile as the main function is required to compile any C program file.
Yes, she can compile as main( ) is not required at compile time.
Yes, she can compile and run as the system will supply default values to fact function.
The difference between variable declaration and variable definition is:
Declaration and definition are the same. There is no difference.
A declaration is used for variables and definitions is used for functions.
Declaration associates type to the variable whereas definition associates scope to the variable.
Declaration associates type to the variable whereas definition gives the value to the variable.
How many times the below loop will be executed?
#include<stdio.h>
int main()
{
int x, y;
for(x=5;x>=1;x--)
{
for(y=1;y<=x;y++)
printf("%dn",y);
} }
15
11
10
13
Are the expressions arr and &arr same for an array of 10 integers?
Yes
No
Find the output of the following code?
#include<stdio.h>
int main()
{
float f = 0.1;
if (f = 0.3)
printf ("yes");
else printf ("no");
}
Yes
No
What does the following declaration mean?
int (*ptr)[10];
ptr is array of pointers to 10 integers
ptr is a pointer to an array of 10 integers
ptr is an array of 10 integers
ptr is an pointer to array
