source file name: Sizeofop.C
#include <stdio.h>
struct student
{
int rollno;//2B
char name[15]; //15B
char studclass[8];//8B
char city[15]; //15B
}; // total=40 B
int main()
{
int n;
char city[10];
int A[20];
float F[5];
struct student s1;
struct student s[5];
//clrscr();
printf("\n Memory of different data types: ");
printf("\n Memory of Integer= %d Bytes",sizeof(int));
printf("\n Memory of Integer= %d Bytes",sizeof(n));
printf("\n Memory of Character= %d Bytes",sizeof(char));
printf("\n Memory of Long= %d Bytes",sizeof(long));
printf("\n Memory of Float= %d Bytes",sizeof(float));
printf("\n Memory of double= %d Bytes",sizeof(double));
printf("\n\n Memory of different Arrays: ");
printf("\n Memory of Character array = %d Bytes",sizeof(city));
printf("\n Memory of Integer Array= %d Bytes",sizeof(A));
printf("\n Memory of Float Array= %d Bytes",sizeof(F));
printf("\n \n Memory of different strutures data types: ");
printf("\n Memory of structure student= %d Bytes",sizeof(struct student));
printf("\n Memory of array structure student= %d Bytes",sizeof(s));
//getch();
return 0;
}
output:
0 Comments
Post a Comment