TCS Company Programming Program

Given the below statements about C programming language.
1) main() function should always be the first function present in a C program file
2) all the elements of a union share their memory location
3) A void pointer can hold the address of any type and can be type casted to any type
4) A static variable holds random junk value if it is not initialized
Which of the above are correct statements?
1) 2,3 2) 1,2 3) 1,2,3 4) 1,2,3,4

Read Solution (Total 4)

TCS Other Question

What is the output of this C code?
#define a 20
int main()
{
const int a = 50;
printf("a = %dn", a);
}
1)a=50 2)a=20 3)Run time error 4)Compilation Error
There is a shop that sells cylindrical cans containing peanut butter. All the cylindrical cans are uniform with diameter of each being 16 cm and height being 24 cm. You are planning to buy 50 such cans and place label of company around the surface of each can at a uniform spacing of 2 cm from both the top and the bottom of the can. The ends of the label just join together. What is the area of paper, in cm², that is required to print such labels for the cans that you are planning to buy?
1)1600 π 2)2400 π 3)16000 π 4)3200 π