Header Ads Widget

Ticker

6/recent/ticker-posts

Write c program to print size of diffrent type of pointer veriable

COMPUTER GAYN


Q. Write c program to print size of diffrent type of pointer veriable?

ans:-           #include<stdio.h>

                     int main()

                    {

             int i;

             float f;

            double d; //value veriable

            char c;

            int *ip;

           float *fp;

           double *dp;//pointer type veriable

           char *cp;

          printf("int size =%d \n",sizeof(i));

          printf("float size =%d \n",sizeof(f));

          printf("double size =%d \n",sizeof(d));

          printf("char size =%d \n",sizeof(c));

          printf("int * size =%d \n",sizeof(ip));

          printf("float * size =%d \n",sizeof(fp));

          printf("double * size =%d \n",sizeof(dp));

          printf("char * size =%d \n",sizeof(cp));

        return0;

                 }

 

Post a Comment

0 Comments