C Program to find size of various data types write code

itstudentjunction

C program to find sizes of various data types write code


Data types: Various data types in c are



int
char
float
double
short
long

sizeof(datatype) : this operator is used to find sizes of various datatypes

note: size of void returns compilation error

 

write a C program to find sizes of various data types

write a C program to find sizes of various data types

#include <stdarg.h>
#include <stdio.h>
int main (void)
{
printf ("To find sizes of various datatypes");
printf ("size of char=%d \n" "size of short=%d\n" "size of long =%d\n""size of float =%d\n""size of int =%d\n" "size of double =%d\n", (int)sizeof (char), (int)sizeof (short), (int)sizeof (long), (int)sizeof (float), (int)sizeof (int *), (int)sizeof (double *));
}

OUTPUT:

To find sizes of various datatypes
size of char=1
size of short=2
size of long=4
size of float=4
size of int=2
size of double=8


list of c programs




Most popular programs




print factorial number
function with no args & return value
even / odd using c
perfect number
write a program to find prime factors
pascal Triangle
check string length strlen
convert a string to lowercase
simple interest using macros
armstrong or not in c
prime numbers
towers of hanoi
Floyd’s Triangle
last occurrence of substring
first occurrence of substring
string combinations
external variable scope
palindrom number
find prime or not  
strong or not
check substring
find factors
reverse string strrev
biggest of three numbers
largest and smallest values in array
write a C program to find sizes of various data types
function with no args & no return value
concatinate strings strCat
write a program to check palindrome string
prime numbers
compare strings strcmp
strong numbers
perfect numbers
last occurrence of character
copy one file to other file
function with args & no return value
students scoring 50% more marks
add sparse matrices
display character graph
gcd using recursion
first occurrence of character
convert to uppercase
multiply sparse matrices using c
result of power value
reverse a number using recursion
static variable scope
permutations
combinations
area of triangle
function with args & return value
print pyramid of stars
numbers in words format
write a C program for automatic variable scope
represent sparse matrix
sizes of various data types
add subtract two complex numbers
wrire a program to show student grades
achromatic string
biggest of three numbers
escape charaters
logical operations
swap numbers without temp
multiply complex numbers
add modify delete employee data
register variable scope
swap numbers using call by reference
maximum and minimum values
student records into file






C Programs Data structures Programs in c Data structures Programs in c++ Computer Graphics Programs Unix commands Linux commands HTML programmingC++ programs,Data structures Algorithms, Java Programs UML Diagrams Assembly Language Programs DBMS j2ee programming c tutorials c++ tutorials java tutorials Data structures tutorials DBMS tutorials