Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <windows.h>
- #include "bars2.h"
- char username[50], letter[4]={'0'}, mainswitch[4] ={'0'};
- int checksum = 0, leave = 0;
- void close();
- main(){
- char ;
- int login;
- //Welcome page
- for (login = 0; login < 2; login++){
- printf(" Welcome To My World %s""\n", username);
- printf(" SlipLine Ind. ""\n");
- printf("\n\n\n\n");
- if (login < 1){
- printf(" Please Login\n");
- printf(" User Name: ");
- scanf("%s", username);
- flushall();
- system("cls");
- }
- }
- printf(" Preparing the System");
- //end of welcome
- //wait for small time
- Sleep(2 * 1000);
- //progress Bar
- progress(2);
- //starting other stuff
- while(1){
- system("pause");
- system("cls");
- printf(" Welcome %s What would you like to do today?\n", username);
- printf(" 1. Add some numbers together\n");
- printf(" 2. Subtract some numbers\n");
- printf(" 3. Prefom an equation\n");
- printf(" 4. Random number generator\n");
- printf(" 9. Crash the computer\n");
- printf(" E. exit program\n");
- if (fgets(mainswitch, 4, stdin) == NULL)
- break;
- printf("char: '%c'", mainswitch[0]);
- switch(mainswitch[0]){
- case '1': printf("in 1"); break;
- case '2': printf("in 2"); break;
- case '3': printf("in 3"); break;
- case '4': printf("in 4"); break;
- case '9': printf("in 9"); break;
- case 'e': case 'E':{
- close();
- }break;
- default: printf("in default"); break;
- }
- //system("cls");
- }
- system("pause");
- }
- void close(){
- printf(" Are you sure you wish to Exit (y/n): ");
- while(leave != 1){
- if (fgets(letter, 4, stdin) != NULL){
- switch(letter[0]){
- case 'y': case 'Y': progress(3); leave = 1; break;
- case 'n': case 'N':{
- return;
- }break;
- default: {
- printf("Im sorry try again");
- Sleep(1 * 1000);
- system("cls");
- printf(" Are you sure you wish to Exit (y/n): ");
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment