5. Write a C program that stores an integer code in a variable called ‘code’. It then prompts the user to enter an integer from the standard input, which we will compare with our original ‘code’. If it matches the code, print ‘Password cracked’, otherwise, prompt the user to try again. For example, int code = 23421; //23421 is the code here.

PHOTO EMBED

Sat Jul 22 2023 12:44:45 GMT+0000 (Coordinated Universal Time)

Saved by @Codes

// Online C compiler to run C program online
#include <stdio.h>
#include <stdbool.h>

int main() {
    int code = 1324;
    int n;
    printf("Enter the number: ");
    scanf("%d", &n);
    if(code==n){
        printf("Password cracked");
    }
    else{
        printf("Try again");
    }
     
    return 0;
}
content_copyCOPY