-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemailvalidator.c
More file actions
37 lines (36 loc) · 854 Bytes
/
emailvalidator.c
File metadata and controls
37 lines (36 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//email verifier
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main(){
int i=0,j=0,count=0,at=0;
char s[100],c[]={".com"};
printf("enter the mail id : ");
scanf("%s",&s);
int l= strlen(s),m=strlen(c);
while(i<l){
if(s[i]=='@'){
while(m>=0){
if(s[l]==c[m]){
m--;
l--;
count++;
}
else{
printf("please enter in right format \n");
count--;
break;
}
}
at++;
}
i++;
}
if(at==0 || at!=1){
printf("enter valid mail include only 1 @ ");
}
else if(count==5){
printf("email is correct");
}
getch();
}