#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 PostHey Try compiling it with any other compiler or try this
#include<conio.h> [..] void main() [...] clrscr(); [...] getch();
That won't work on any other compiler because it isn't standard C. It will probably only work on Turbo C, which is outdated.
At brianvolkmann :
You …
Jump to PostYou still have a mismatch in brackets. Count how many opening and closing brackets you have. These two numbers should be equal. To avoid these kinds of problems, google for code-indention.
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.