#include<iostream> #include <ctime> #include<stdlib.h> #include <conio.h> #include <string> #include <Windows.h> using namespace std; int main() { time_t begin,end; bool flag = true; string ch; begin = time(NULL); while(flag) { end = time(NULL); if(difftime(end,begin)<30) { cout<<"Enter your answer"<<endl; getline(cin,ch); } if(difftime(end,begin)>30) { flag = false; cout<<"Sorry you are timed out"<<endl; } } system("pause"); }
return;
return
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)