Creating a OTP generator using C++..

  Рет қаралды 16

GAMERZZ HUB

GAMERZZ HUB

20 күн бұрын

Plz make sure to like and subscribe..
code:-- use word and exchange {, to right side} and {. for left side}
#include ,iostream.
#include ,Windows.h.
#include ,random.
using namespace std;
int main() {
// Make sure that to like the video and subscribe to the channel
// for more updates and tutorials
// ----------------------------------------------------------------
// Create a random generator object
random_device rdG;
uniform_int_distribution,int. OTP(1000 , 10000); // This is the program for 4-digit OTPs genration,, for 6 digit change the 4 digit
// value to 6 digit values
int OTP_Number = OTP(rdG); // Generate a random Otp number and stores it in the variable.
int UserInput;
// Printing the OTP number
cout ,, "Genrating OTP..... " ,, endl;
Sleep(5000); // To make it look like real and not an instant result,, you can also remove it for instant results.....
system("cls"); // clearing the old couts and printings from the terminal.
cout ,, "Your Otp is: " ,, OTP_Number ,, endl; // Printing or telling the otp
Sleep(10000); // Waiting for ten seconds for reading time..
system("cls");
for (int i = 0; i , 4; i++) {
// Asking for OTP..
cout ,, "Please enter your OTP: ";
cin .. UserInput;
// cin.ignore(); -.no because it will cause the user input to not be checked..
if (UserInput == OTP_Number) {
cout ,, "The entered OTP is correct: " ,, endl;
exit(0); // Exiting with no issues
}
else if (i , 4) {
cout ,, "Invalid: try again; " ,, endl;
}
else {
cout ,, "Error: " ,, endl; // Error message
}
}
//return 0; // Program ends here, nothing more to do here // Can be added if wanted..
}

Пікірлер: 1
Why I Chose Rust Over Zig
33:18
ThePrimeTime
Рет қаралды 33 М.
Tinkering With Spirographs in C++
22:01
javidx9
Рет қаралды 15 М.
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 1,6 МЛН
THE POLICE TAKES ME! feat @PANDAGIRLOFFICIAL #shorts
00:31
PANDA BOI
Рет қаралды 25 МЛН
Was ist im Eis versteckt? 🧊 Coole Winter-Gadgets von Amazon
00:37
SMOL German
Рет қаралды 39 МЛН
Best father #shorts by Secret Vlog
00:18
Secret Vlog
Рет қаралды 22 МЛН
Everything Starts with a Note-taking System
21:23
Mischa van den Burg
Рет қаралды 172 М.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 923 М.
Unit Testing a PHYSICS ENGINE | C++  Game Engine Devlog #12
19:00
Guilherme Teres
Рет қаралды 406
Extreme vlogging on cycle 👍🥶
11:25
GAMERZZ HUB
Рет қаралды 116
why do header files even exist?
10:53
Low Level Learning
Рет қаралды 377 М.
Trying to SPEED RUN Poppy Playtime chapter 1..
9:52
GAMERZZ HUB
Рет қаралды 225
FC 24 Euro 2024 second match Protugal vs Turkey(group stage)
17:58
How to learn Haskell as a Scala developer
17:28
Impure Pics
Рет қаралды 727
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 386 М.
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 1,6 МЛН