Thursday, September 13, 2018

MONEY WITH ARUN

  • Problem Description

    Arun has given half of the amount to his friends whenever he met his friends, the money left in arun hand is passed as the input and the number of friends be who receive the money as a input, you should print the inital amount arun had in his hand. Use structure to implement the code.

    Input Method

    Integers of values of amount and number of friends

    Output Method

    Initial amount of Arun

    Explanation:

    Suppose Arun have Rs.100 in his hand at the end, gave money to 2 friends refers the initial amount
    calculated by 100*2=200, 200*2=400, so initial amount of Arun is Rs.400.
  • CODING ARENA
  • #include <stdio.h>
    #include <math.h>
    int main()
    {
      int n,i,a;
      scanf("%d%d",&n,&a);
      /*for(i=1;i<=a;i++)
      {*/
       i=n*pow(2,a);
     // }
      printf("%d",i);
      return 0;
    }
  • Test Case 1

    Input (stdin)
    100 2
    
    
    Expected Output
    400
  • Test Case 2

    Input (stdin)
    100 5
    
    
    Expected Output
    3200

1 comment:

  1. I recently found many useful information in your website especially this blog page. Among the lots of comments on your articles. Thanks for sharing. convert money calculator

    ReplyDelete