#include <stdio.h>
#include <conio.h>
main ()
{
clrscr();
printf ("\n An int is %d bytes", sizeof (int));
printf ("\n A char is %d bytes", sizeof (char));
printf ("\n A short is %d bytes", sizeof (short));
printf ("\n A long is %d bytes", sizeof (long));
printf ("\n A float is %d bytes", sizeof (float));
printf ("\n A double is %d bytes", sizeof (double));
printf ("\n An unsigned char is %d bytes", sizeof (unsigned char));
printf ("\n An unsigned int is %d bytes", sizeof (unsigned int));
return 0;
}
OUTPUT:
An int is 2 bytes
A char is 1 bytes
A short is 2 bytes
A long is 4 bytes
A float is 4 bytes
A double is 8 bytes
An unsigned char is 1 bytes
An unsigned int is 2 bytes
Sample C Program To Input & Multiply Two Numbers.
#include <stdio.h>
#include <conio.h>
void main()
{
clrscr();
int a, b, c;
printf(" Enter the numbers to be multiplied: ");
scanf(" %d %d ", &a, &b);
c = a * b;
printf(" The product of the numbers is: %d ",c);
getch();
}
OUTPUT:
Enter the numbers to be multiplied: 10
5
The product of the numbers is: 50
ALSO READ:
-- Program To Print First Ten(10) Natural Numbers.
-- Program To Print Fibonacci Series Upto 100.
-- Program To Check Whether A Number Is Prime Or Not.
-- Program To Compute The Reverse Of A Number.
-- Program To Print A Semicolon Without Using A Semicolon.
-- Program To Display Function Without Using The Main Function.
-- Program To Print Any Print Statement Without Using Semicolon.
-- Program To Display Its Own Source Code As Its Output.
-- Program To Swap Two Strings Using strcpy() Function.
-- Program to accept a string and print the reverse of the given string.
-- Program To Get IP Address.
-- Program To Accept An Integer & Reverse It.
-- Program To Convert Given Number Of Days To A Measure Of Time Given In Years, Weeks & Days.
-- Program To Illustrate The Concept Of Unions.
-- Program To Find The Size Of A Union.
... Back To C++ FAQ's Index
... Back To C Programs Index
... Back To C FAQ's Index
... Back To HR Interview Index
Comments
Post a Comment
Please share your opinions and suggestions or your experience in the comments section. This way we can all help each other...
Experienced guys can share their resumes at admin@interview-made-easy.com