how to find the size of the data type like int,float
without using the sizeof operator?

Answer Posted / vignesh1988i

#include<stdio.h>
#include<conio.h>
void main()
{
int ptr,a[2];
char ptr1,b[2];
float ptr2,c[2];
ptr=(a+1)-a;
ptr1=(b+1)-b;
ptr2=(c+1)-c;
printf("int : %d\n",ptr);
printf("char : %d\n",ptr1);
printf('float : %d\n",ptr2);
getch();
}


than ku

Is This Answer Correct ?    0 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

1584


Explain how can I right-justify a string?

625


What is difference between array and pointer in c?

540


What does the error 'Null Pointer Assignment' mean and what causes this error?

743


What is c definition?

746






Explain enumerated types in c language?

606


write an interactive C program that will encode or decode a line of text.To encode a line of text,proceed as follows. 1.convert each character,including blank spaces,to its ASCII equivalent. 2.Generate a positive random integer.add this integer to the ASCII equivalent of each character.The same random integer will be used for the entire line of text. 3.Suppose that N1 represents the lowest permissible value in the ASCII code,and N2 represents the highest permissible value.If the number obtained in step 2 above(i.e.,the original ASCII equivalent plus the random integer)exceeds N2,then subtract the largest possible multiple of N2 from this number,and add the remainder to N1.Hence the encoded number will always fall between N1 and N2,and will therefore always represent some ASCII character. 4.Dislay the characters that correspond to the encoded ASCII values.  The procedure is reversed when decoding a line of text.Be certain,however,that the same random number is used in decodingas was used in encoding.

2721


Differentiate between Macro and ordinary definition.

731


Write the test cases for checking a variable having value in range -10.0 to +10.0?

1817


Explain the properties of union.

611


how to find binary of number?

3439


What is data type long in c?

625


How do we print only part of a string in c?

587


How can I use a preprocessorif expression to ?

601


if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.

4505