30.12.20

c program to print the size of the datatype using sizeof()

 SWAPPING WITHOUT USING THIRD VARIABLE

PROGRAM:
#include<stdio.h>
int main()
{
printf("size of char =%d\n",sizeof(char));
printf("size of short =%d\n",sizeof(short));
printf("size of int=%d\n",sizeof(int));
printf("size of long =%d\n",sizeof(long));
printf("size of float =%d\n",sizeof(float));
printf("size of double =%d\n",sizeof(double));

return 0;
}


OUTPUT:
size of char=1
size of short=2
size of int=4
size of long=4
size of float=4
size of double=8




No comments:

Post a Comment

JAVA program pattern 2

import java.util.Scanner; public class pattern3 { public static void main(String args[]) { int i,j; Scanner sc=new Scanner(System.in); Syste...