Aynı şifreyi iki kere girmeniz gerek. İki şifreyi de aynı girdiyseniz çıktı olarak "Basarili bir sekilde kayit oldunuz..." vermesi gerekiyor.
Test etmek için Online Compiler;
www.programiz.com
Test etmek için Online Compiler;
Online C Compiler
The user friendly C online compiler that allows you to Write C code and run it online. The C text editor also supports taking input from the user and standard libraries. It uses the GCC C compiler to compile code.
C:
#include <stdlib.h>
#include <stdio.h>
int main()
{
char sifre[16];
char sifreDogrulama[16];
int i, yanlis;
while (1)
{
yanlis = 0;
i = 0;
printf("Parolanizi giriniz.\n");
scanf("%s", &sifre);
printf("Parolanizi tekrar giriniz.\n");
scanf("%s", &sifreDogrulama);
while (!(sifre[i] == '\0' && sifreDogrulama[i] == '\0'))
{
if (sifre[i] != sifreDogrulama[i])
{
printf("Parolalariniz uyusmuyor. Lutfen tekrar deneyin.\n");
yanlis = 1;
break;
}
else
{
i++;
}
}
if (yanlis == 0)
{
printf("Basarili bir sekilde kayit oldunuz...\n");
break;
}
}
system("pause");
return 0;
}