union
{
char ch[10];
short s;
}test;
test.s = 0xabcd;


main()
{
printf("%d",ch[10]);
}

Answer Posted / vipul

the program is incorrect bcz in main function %d is used for integer type value and union is same as the structure and there is no return type in the main function thus it will return a charter type value,

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

given post order,in order construct the corresponding binary tree

2312


How do you write a program which produces its own source code as output?

600


What is 02d in c?

632


What is enumerated data type in c?

617


What is the difference between text files and binary files?

669






What does dm mean sexually?

806


What is structure in c definition?

568


Write a program which returns the first non repetitive character in the string?

592


What is atoi and atof in c?

612


What is the purpose of scanf() and printf() functions?

711


What does the c preprocessor do?

613


the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....

22183


The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none

759


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

1695


Why is extern used in c?

609