#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
char name[30];
char pass[30];
printf("Enter the name");
gets(name);
int count=strlen(name);
printf("\n");
printf("Enter your password");
gets(pass);
if((strcmp("Hamza" ,name)==0) && (strcmp("moon" ,pass)==0)){
printf("Welcome %s" ,strrev(name));
}
else{
printf("sorry");
}
printf("\n");
if (count>=5){
printf ("password correct");
}
else {
printf("Sorry");
}
return 0;
}
Output
#include <stdlib.h>
#include <string.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
char name[30];
char pass[30];
printf("Enter the name");
gets(name);
int count=strlen(name);
printf("\n");
printf("Enter your password");
gets(pass);
if((strcmp("Hamza" ,name)==0) && (strcmp("moon" ,pass)==0)){
printf("Welcome %s" ,strrev(name));
}
else{
printf("sorry");
}
printf("\n");
if (count>=5){
printf ("password correct");
}
else {
printf("Sorry");
}
return 0;
}
Output
Share With Friend's
Comments
Post a Comment