Write a simple program to find the size of different basic
data types in C.
Answers were Sorted based on User's Feedback
Answer / rajiv
int x,y,b;
char a;
x=sizeof(y);
b=sizeof(a);
printf("the size of int is %d & the size of char is
%d",x,b);
Is This Answer Correct ? | 20 Yes | 4 No |
Answer / jugad
#include
#include
int main()
{
printf(ā%d %d %d %dā,sizeof(int),sizeof(unsigned
int),sizeof(float),sizeof(char));
getch();
return 0;
}
courtesy:http://answerwale.co.cc/?p=23
Is This Answer Correct ? | 21 Yes | 7 No |
Answer / gajendra patil
#include <stdio.h>
#include <conio.h>
int main(){
int *a;
printf("\nSIZE OF DIFFERENT DATA TYPES\n");
printf("\n------------------------------");
printf("\n\tBASIC");
printf("\n------------------------------");
printf("\nCHARACTER \t: %d byte(s)",sizeof(char));
printf("\nSHORT \t\t: %d byte(s)",sizeof(short));
printf("\nINTEGER \t: %d byte(s)",sizeof(int));
printf("\nLONG \t\t: %d byte(s)",sizeof(long));
printf("\nFLOAT \t\t: %d byte(s)",sizeof(float));
printf("\nDOUBLE \t\t: %d byte(s)",sizeof(double));
printf("\nLONG DOUBLE \t: %d byte(s)",sizeof(long double));
printf("\nLONG LONG \t: %d byte(s)",sizeof(long long));
printf("\nPOINTER (any) \t: %d byte(s)",sizeof(*a));
printf("\nARRAY \t\t: sizeOfDataType * sizeOfArray [eg. int a[10]=%d byte(s)]",sizeof(int)*10);
printf("\n------------------------------");
return 0;
}
Is This Answer Correct ? | 5 Yes | 2 No |
Tell me what is null pointer in c?
a program that can input number of records and can view it again the record
What are examples of structures?
What is the explanation for modular programming?
write a programme to enter some number and find which number is maximum and which number is minimum from enterd numbers.
How can I read a binary data file properly?
Juxtapose the use of override with new. What is shadowing?
What is echo in c programming?
Dear Sir, we are required the bubble sorting programs Regs Prem
What is the output of the program #include<stdio.h> #include<conio.h> void main() {0 int i,j=20; clrscr(); for(i=1;i<3;i++) { printf("%d,",i); continue; printf("%d",j); break; } getch(); }
What is the difference between volatile and const volatile?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above