Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


write a program for size of a data type without using
sizeof() operator?

Answers were Sorted based on User's Feedback



write a program for size of a data type without using sizeof() operator?..

Answer / mazhar shaikh

datatype a,*p,*q;
p=&a;
q=p+1;
cout<<abs(int(p)-int(q))<<endl;

Is This Answer Correct ?    5 Yes 7 No

write a program for size of a data type without using sizeof() operator?..

Answer / vignesh1988i

#include<stdio.h>
#include<conio.h>
void main()
{
int integer[2],p;
float floating[2],q;
char character[2],r;
double doubling[2],s;
clrscr();
p=(integer+1)-integer;
q=(floating+1)-floating;
r=(character+1)-character;
s=(doubling+1)-doubling;
printf("the sizeof int is :%d",p);
printf("\nthe size of float is :%d",q);
printf("\nthe size of character is :%d",r);
printf("\nthe size of double is :%d",s);
getch();
}


thank u

Is This Answer Correct ?    5 Yes 11 No

Post New Answer

More C Interview Questions

What is the use of void pointer and null pointer in c language?

0 Answers  


What is difference between static and global variable in c?

0 Answers  


what is the advantage of using SEMAPHORES to ORDINARY VARIABLES???

2 Answers   NSN,


What is the difference between fread and fwrite function?

0 Answers  


Explain about the functions strcat() and strcmp()?

0 Answers  


Are pointers really faster than arrays?

0 Answers  


Is it valid to address one element beyond the end of an array?

0 Answers  


What is a floating point in c?

0 Answers  


main() { enum _tag{ left=10, right, front=100, back}; printf("%d, %d, %d, %d", left, right, front, back); }

1 Answers   Accenture, Vector,


program to convert a integer to string in c language'

0 Answers  


What is header file definition?

0 Answers  


What is C language Terminator?

15 Answers   TCS,


Categories