Monday, 15 June 2015

C program using sizeof() operator

WAP to display the size of integer,float and char using sizeof() operator
    Program:
#include<stdio.h>
#include<conio.h>


int main()
{
int x;    //Declaring Variable.

float y;   //Declaring Variable.
double z;   //Declaring Variable.
char ch;    //Declaring Variable.



printf("Size of integer variable x:%d\n",sizeof(x));  //For printing
printf("Size of float variable y:%d\n",sizeof(y));  //For printing
printf("Size of double variable z:%d\n",sizeof(z));   //For printing
printf("Size of character variable char:%d\n",sizeof(char));   //For printing


getch();   //Getting a chracter or waiting for key press.
return 0;




Output:


Video Explanation
Sorry Guys Explanation of this tutorial will be posted later this month.

No comments:

Post a Comment