Calculate the Number of Bytes Allocated for the Given Integer Variables using the Size() Operator. - Learn Engineering

All the news and updates relevant to Engineering. You can also Write a post here

Breaking

Friday, July 10, 2020

Calculate the Number of Bytes Allocated for the Given Integer Variables using the Size() Operator.

Learn C programming

Question

Calculate the Number of Bytes Allocated for the Given Integer Variables using the Size() Operator.

Input Format

1<=StringLength<=100

Sample TestCase Expected Output

1. 124

Answer

#include <stdio.h>
int main()
{
    int num,allocated;
    scanf("%d",&num);
    allocated = sizeof(num);
    printf("%d",allocated);
    return 0;
}


Comment What problem Do you Need...

Follow Us For More...

1 comment: