+ 1
What is the size of long int, long long int and long double for 64 bit architecture computer?
Tell me the updated size for the integers and floating point numbers.It depends of the architecture of a computer
1 Answer
+ 3
#include <stdio.h>
int main()
{
printf("int=%ld\n",sizeof(int));
printf("long int = %ld\n",sizeof(long int));
printf("long long int =%ld\n",sizeof(long long int));
/* edit also see
printf("float = %ld\n",sizeof(float));
printf("double = %ld\n",sizeof(double));
printf("long double = %ld",sizeof(long double));
printf("\nchar=%ld",sizeof(char));
*/
return 0;
}
/*
You can find sizes by the above program..
for 64 bit, - it is generally 4bytes for int.
Size is determined by compiler dependent and Arcitectutre implementation.
*/