Professional Documents
Culture Documents
ASSIGNMENT -:
Topic - CHOCOLATE WRAPPER PROBLEM
SUBMITTED TO -
BIJOY CHAND CHATTERJEE
1. Start
7. End
Code for the above algorithm: -
#include <iostream>
using namespace std;
// Driver code
int main()
{
int money ; // total money
int price ; // cost of each candy
int wrap ; // no of wrappers needs to be
cout << "enter the values for money , price
,wraps\n";
cin >> money>>price>>wrap;
// exchanged for one chocolate.
Time complexity -:
The time complexity of a given solution O(m) ..where m
is the no. Of iterations.
Output -