#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
#include<string.h>
#define ff fflush(stdin);
void main()
{
int r;
char str1[10], str2[10];
clrscr();
printf("Enter password:\n");
gets(str1);
ff;
printf("Re-enter password:\n");
gets (str2);
ff;
r=strcmp(str1, str2);
if(r==0)
{
printf("Enter");
}
else
{
printf("Exit");
}
getch();
}
brianvolkmann
0
Newbie Poster
Recommended Answers
Jump to PostI only got 2 errors with the upper program:
1) the main () cannot be void with my compiler so i put in int main()
2) The function Clrscr(); is invalid. If you wanted to use the clear screen function then you can type cls; instead of it.
…
Jump to PostHey Try compiling it with any other compiler or try this
#include<stdlib.h> #include<stdio.h> #include<conio.h> #include<string.h> #define ff fflush(stdin); void main() { int r; char str1[10], ; clrscr(); printf("Enter password:\n"); gets(str1); ff; char str2[10]="password"; // TYPE THE PASSWORD HERE. ff; r=strcmp(str1, str2); if(r==0) { printf("Enter"); } else { …
All 6 Replies
Sky Diploma
571
Practically a Posting Shark
brianvolkmann
0
Newbie Poster
Sky Diploma
571
Practically a Posting Shark
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
brianvolkmann
0
Newbie Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.