#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
static const char alphabet_Numbers[] =
"0123456789"
"!@#$&"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
int size = sizeof(alphabet_Numbers) - 1;
int main()
{
system("color a");
//password length
int length = 8;
srand(time(0));
for (int i = 0; i < length; i++)
{
cout << alphabet_Numbers[rand() % size];
}
return 0;
}

#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
static const char alphabet_Numbers[] =
"0123456789"
"!@#$&"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
int size = sizeof(alphabet_Numbers) - 1;
int main()
{
system("color a");
//password length
cout<<"enter your desired length \n";
cin>>length;
srand(time(0));
for (int i = 0; i < length; i++)
{
cout << alphabet_Numbers[rand() % size];
}
return 0;
}