Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Different variable scanf/printf statements
#include <stdio.h> // size of basic data types in C int main(void) { int answer; short myFirst = 1; long mySecond = 2; float myThird = 3.0; double myFourth = 4.4; long double myFifth = 5.54; char myCharacter = 'p'; /* The size of various types */ printf("The size of int %zu\n", sizeof(answer)); printf("The size of short %zu\n", sizeof(myFirst)); printf("The size of long %zu\n", sizeof(mySecond)); printf("The size of float %zu\n", sizeof(myThird)); printf("The size of double %zu\n", sizeof(myFourth)); printf("The size of long double %zu\n", sizeof(myFifth)); printf("The size of char %zu\n", sizeof(myCharacter)); printf("myFirst is %hd\n", myFirst); printf("mySecond is %ld\n", mySecond); printf("myThird is %f\n", myThird); printf("myFourth is %lf\n", myFourth); printf("myFifth is %lF\n", myFifth); printf("myCharacter is %c\n", myCharacter); return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
B_141121_aleatorios
Lab 11 v.05
B_141128_MatrizProducto
C_141113_euclides
FUNTION3
Largest and Second Largest number in an array
02468
Lab 9 v0.8
150116_FactorialPrimo
co_4
stackse - search stackoverflow differently
Please log in to post a comment.