ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
ok here is my problem im trying to get this program to loop and loop and cant get it to. ok here is the code and im about to go crazy crazy crazy i dont know what im doing wrong. can anyone help me.
all i want the code to do is just loop over and over again... this is what i get when i run it....
Code:
>><<>><< 1 /-|/| 7#3 1337357 /-|>,()(_)|||) <<>><<>><<>
Temprature Conversion Program
A. Farehnheit to Centigrade
B. Centigrade to Farehnheit
C. EXIT
SELECT A/B/C>_a
Farehnheit Temprature 3.33
Farehnheit Temp (3.33)
Centigrade Converted Temp (-15.93)
>><<>><< 1 /-|/| 7#3 1337357 /-|>,()(_)|||) <<>><<>><<>
Temprature Conversion Program
A. Farehnheit to Centigrade
B. Centigrade to Farehnheit
C. EXIT
SELECT A/B/C>_NOT VALID ENTRY
>><<>><< 1 /-|/| 7#3 1337357 /-|>,()(_)|||) <<>><<>><<>
Temprature Conversion Program
A. Farehnheit to Centigrade
B. Centigrade to Farehnheit
C. EXIT
SELECT A/B/C>_
am i missing something? is it a stupid simple mistake that im missing or a huge ass mistake please help me thanx......
YOU ARE FOOKING AWSOME !!!! thnx....... it works awsomely... now i just dont know how to clear the screen after it loops ... thanx :P :P :P im so excited..
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
printf("\033[H\033[J"); is clearing the screen with most terminal emulators, if you want a 100% portable solution look at curses.
the loop (and the program) should already stops with your test:
if (cCode == 'C' || cCode == 'c')
the construction:
if (cCode != 'a','b','c','d')
is certainly not doing what you expect (this test is always true).
Your program would greatly improve should you use the switch/case syntax vs all these ifs, and with a better care of the spelling, specially for the dialog with the user
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.