Thread: smallest coin

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    222

    smallest coin

    I am trying to find the amount here.
    Input

    The first line of input contains an integer M, the number of coins in bank.
    The second line of input contains M integers: coin1, coin2... coinN. coini represents ith coin.

    Output
    Print smallest possible amount of cash that you will not be able to pay in super market.

    Code:
    int solution(int count_coin, int coin[count_coin])
    {
            float coin1=0.50,total=0.0;
    	int ncoins;
    	printf("Number of 50 coins : ");
    	scanf("%d",&ncoins);
    	total += (ncoins * coin1);
    	printf("** %.2f **",total);
            return;
    }
    Last edited by leo2008; 01-08-2022 at 08:50 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sum up the largest and smallest ones
    By programmer1 in forum C Programming
    Replies: 8
    Last Post: 11-08-2011, 11:35 AM
  2. Replies: 22
    Last Post: 05-29-2009, 05:44 PM
  3. need to find smallest int
    By lankeveil in forum C Programming
    Replies: 3
    Last Post: 11-30-2008, 05:48 AM
  4. largest and smallest
    By eldemonio in forum C Programming
    Replies: 9
    Last Post: 10-15-2007, 02:00 PM
  5. smallest int problem
    By jms318 in forum C Programming
    Replies: 13
    Last Post: 12-05-2006, 03:52 PM

Tags for this Thread