Sizeof Practice
Determining the Byte Size of the int Data Type
main
9
1
2
3
4
5
6
7
8
#include <stdio.h>
int main()
{
printf("Size of int type: %d bytes\n", sizeof(int));
return 0;
}
12345678#include <stdio.h> int main() { printf("Size of int type: %d bytes\n", sizeof(int)); return 0; }
Task
Swipe to start coding
To find out how many bytes the short
data type occupies, you can employ the sizeof()
function.
Solution
9
1
2
3
4
5
6
7
8
#include <stdio.h>
int main()
{
printf("Size of short type is %d bytes\n", sizeof(short));
return 0;
}
Everything was clear?
Thanks for your feedback!
Section 2. Chapter 9
9
1
2
3
4
5
6
7
8
#include <stdio.h>
int main()
{
printf("Size of short type is %d bytes\n", ___(___));
return 0;
}
Ask AI
Ask anything or try one of the suggested questions to begin our chat