DevelopersSociety

Tuesday, December 9, 2014

C++ Tutorial- Program- 3- If Statement using two strings



Code:

#include<iostream>
#include<string.h>
using namespace std;
main()
{   
    string username,password; 
    cout<<"\t\tWelcome To Hamdard University,khi"<<endl;
    cout<<"Enter Username:";
    cin>>username;
    cout<<"Enter Password:";
    cin>>password;
if(username==password)
{
cout<<"Successfully login"<<endl;
}
else
cout<<"login Failed"<<endl;
}

Output:



No comments:

Post a Comment