brianh
Jan 2nd, 2001, 03:07 PM
I am VERY new at c and I have a very quick and easy question. I have an assigment at school to simply display some information on the command line (command line app). The problem I have is that at the end of it I have to ask, do you really want to quit? I want to scan for yes and if anythying else don't quit. The problem occurs when a user types something in, even yes, instead of quitting it will then say "Press any key to continue". Here is my code....Any suggestions????
// ws1.cpp : Defines the entry point for the console application.
//
//this is the include statement for the header file
#include "stdio.h"
//states that main is the name of the function, it uses no arg's
//and it will return an integer
int main(void)
{
//these statements uses the /t function which "tabs"
//whatever is being displayed by printf
printf("\t\t\t\tCurrency \n");
printf("\t\t\t\tConversion \n");
printf("Pound");
printf("\t\t\t\t\t\t\t1.670 Dollars\n");
printf("Franc");
printf("\t\t\t\t\t\t\t .100 Dollars\n");
printf("Lire");
printf("\t\t\t\t\t\t\t .020 Dollars\n");
printf("Krona");
printf("\t\t\t\t\t\t\t .100 Dollars\n");
printf("Mark");
printf("\t\t\t\t\t\t\t .252 Dollars\n");
//then print a sentence asking the user of they would like to quit
printf("Do you really want to quit (Yes/No)?\n");
//scan for yes, if no don't quit
scanf("yes");
return 0;
}
Also is there any function to center, or right or left justify????
// ws1.cpp : Defines the entry point for the console application.
//
//this is the include statement for the header file
#include "stdio.h"
//states that main is the name of the function, it uses no arg's
//and it will return an integer
int main(void)
{
//these statements uses the /t function which "tabs"
//whatever is being displayed by printf
printf("\t\t\t\tCurrency \n");
printf("\t\t\t\tConversion \n");
printf("Pound");
printf("\t\t\t\t\t\t\t1.670 Dollars\n");
printf("Franc");
printf("\t\t\t\t\t\t\t .100 Dollars\n");
printf("Lire");
printf("\t\t\t\t\t\t\t .020 Dollars\n");
printf("Krona");
printf("\t\t\t\t\t\t\t .100 Dollars\n");
printf("Mark");
printf("\t\t\t\t\t\t\t .252 Dollars\n");
//then print a sentence asking the user of they would like to quit
printf("Do you really want to quit (Yes/No)?\n");
//scan for yes, if no don't quit
scanf("yes");
return 0;
}
Also is there any function to center, or right or left justify????