Write a program to act as an electronic safe, C/C++ Programming

Assignment Help:

Write a program to act as an electronic safe. If the correct code has been entered the program should display "Safe Open".  If an incorrect code is input it should display "Alarm" and cannot be reset.
 
#include stdio.h
void main()

  char prompt;
  int dial,code;
/* set up code */
  printf("Please enter in the numerical code \n\r");
  scanf("%d",&code);
/* Lock up safe */
  printf(" Safe locked \n\r Please enter access ... ");
  scanf("%d",&dial);
  while (dial != code )
  {
    printf("Alarm sounded \n\r");
 
  }
  printf("Safe opened \n\r"); 
  printf("Press any key to exit \n\r");
  scanf("\n%c",&prompt); 
  }


Related Discussions:- Write a program to act as an electronic safe

Explain about the unions, Explain what are Unions? The Unions like as s...

Explain what are Unions? The Unions like as structures, contain members whose individual data types may perhaps differ from one another. Though the members that create a union

#rotation, #write code for rotation in c

#write code for rotation in c

Word counting, Task Your task is to write a program, words, that reports i...

Task Your task is to write a program, words, that reports information about the number of words read from its standard input. For example, if the file qbf.txtcontains the text th

Ascii string related, A string S is said to be "Super ASCII", if it contain...

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Explain structured programming, Explain structured programming The prin...

Explain structured programming The principal idea behind structured programming was as easy as the idea of "divide and conquer." A computer program could be regarded as having

Project, Project Overview A certain financial institution (bank) wishes to ...

Project Overview A certain financial institution (bank) wishes to promote its new business products/services by conducting road shows in rural areas. Their aim is to encourage peop

I want a craiglist poster required, Project Description: I want someone ...

Project Description: I want someone who can post ads for me on Craiglist . I will pay 3$ per ad i need about 30-40 ads per day . Skills required: C Programming, MySQL, Jav

Lcm, lcm program.

lcm program.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd