Hi Guys, I am a beginner programmer in C. I just wrote this simple program and its compile and execute just fine. I just want to know if its a good practice to do what I did on line 17 where I have the return 0;. Please assist me.
Code:#include <stdio.h> int main (void) { char machine_password[] = "HELLO"; char user_password[10]; int attempts = 1; while (attempts <= 3){ printf("Please Enter Your Password\n"); scanf("%s", &user_password); if (!strcmp(user_password, machine_password)){ printf("WELCOME TO YOUR MAIL\n"); system ("PAUSE"); return 0; } else if(attempts <= 3){ printf("INCORRECT PASSWORD\n"); } attempts = attempts +1; } system("PAUSE"); return 0; }