# C++ program to generate CAPTCHA and verify user

In this tutorial, we will be discussing a program to generate CAPTCHA and verify user.

For this, we will provide the user with a random string and ask him to reenter the same string. Then it has to be checked if the given and the input string matches.

The CAPTCHA should be completely random system generated consisting of a-z, AZ and 0-9.

## Example

#include<bits/stdc++.h>
using namespace std;
//checks if the strings are same
}
//generates a random string as Captcha
time_t t;
srand((unsigned)time(&t));
char *chrs = "abcdefghijklmnopqrstuvwxyzABCDEFGHI" "JKLMNOPQRSTUVWXYZ0123456789";
while (n--)
}
int main(){
cout << "\nEnter CAPTCHA : ";
}
nwsraJhiP
CAPTCHA Not Matched