Saturday, August 18, 2018

BYTE VALUE

  • Problem Description

    To find the byte value of a given two variables. In that case need to use 2 variables, first variable gets the value during run time and the second variable holds the value at the time of declaration.
  • CODING ARENA::
  • #include <stdio.h>
    int main()
    {
      float a;
      int x;
      scanf("%f",&a);
      x=sizeof(a);
      printf("%d %ld",x,sizeof(x)*2);

    return 0;
    }
  • Test Case 1

    Input (stdin)
    0.7
    
    
    Expected Output
    4 8
  • Test Case 2

    Input (stdin)
    16.5
    
    
    Expected Output
    4 8

1 comment: