Answers for "random key generator c++ all unique characters"

C++
0

int random string generator c++

string  gen_random(int len) {
        string s;
        static const char alphanum[] =
            "0123456789"
            "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
            "abcdefghijklmnopqrstuvwxyz";

        for (int i = 0; i < len; ++i) {
            s+= alphanum[rand() % (sizeof(alphanum) - 1)];
             }

     return s;
Posted by: Guest on May-26-2020
0

random key generator c++ all unique characters

#include<iostream>

using namespace std;
int main()
{
   float amount, discount, topaid;
   cout<<"Enter Total Amount: ";
   cin>>amount;
   if(amount<=100)
      cout<<"Amount to be Paid: "<<amount;
   else
   {
      if(amount>100 && amount<=200)
      {
         discount = (amount*5)/100;
         topaid = amount-discount;
      }
      else if(amount>200 && amount<=400)
      {
         discount = (amount*10)/100;
         topaid = amount-discount;
      }
      else if(amount>400 && amount<=800)
      {
         discount = (amount*20)/100;
         topaid = amount-discount;
      }
      else
      {
         discount = (amount*25)/100;
         topaid = amount-discount;
      }
      cout<<"Amount to be Paid: "<<topaid;
   }
   cout<<endl;
   return 0;
Posted by: Guest on October-20-2021

Code answers related to "random key generator c++ all unique characters"

Browse Popular Code Answers by Language