his is a program written in C programming language. The wrong this is that this must be an iterration.  The program must ask first to input his password. then the next input will be asking the password again. if the input was not the same it must be repeating, saying incorrect, asking for the password again until the input is correct. like this

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter5: Making Decisions
Section: Chapter Questions
Problem 4PE
icon
Related questions
Question
100%

This is a program written in C programming language. The wrong this is that this must be an iterration.  The program must ask first to input his password. then the next input will be asking the password again. if the input was not the same it must be repeating, saying incorrect, asking for the password again until the input is correct. like this

input password: shaaala

enter your password: shfhfh

incorrect!

enter your password: fjdbifj

incorrect!

enter your password: shaaala

correct!

something like that

here is my code please fix it:

#include <stdio.h>
int main()
{
    int pass = 3456;
    int value;
    
    printf("enter a your password: ");
    scanf("%d", &value);

    if (value == pass)
    {
        printf("password correct\n");
    }
    else
    {
        printf("password is incorrect\n");
    }
    return (0);
}

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT