| | |
Hi to all! I just want to know if my code is right to calcute the quetelet? Thank you
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2006
Posts: 1
Reputation:
Solved Threads: 0
Hi to all! I just want to know if my code is right to calcute the quetelet? Thank you
0
#1 Jun 22nd, 2006
C Syntax (Toggle Plain Text)
#include<stdio.h> #include<conio.h> main() { float x,y,z; clrscr(); printf("\nThis program calculate if you are Underweight,Healthy or Overweight"); printf("\n\n Enter your weight in kilograms:"); scanf("%f",&x); printf("\n\n Enter your weight in meters:"); scanf("%f",&y); z=((y*y)/x); if(z<20){ printf(" the Quetelet-index is: %f",z); printf("\n\n\tUnderweight"); } else{ printf("\n the quetelet-index is : %f",z); printf("\n\n\tOverweight"); } getch(); return 0; }
Last edited by Dave Sinkula; Jun 22nd, 2006 at 10:41 am.
Re: Hi to all! I just want to know if my code is right to calcute the quetelet? Thank you
0
#2 Jun 22nd, 2006
Re: Hi to all! I just want to know if my code is right to calcute the quetelet? Thank you
0
#3 Jun 28th, 2006
Re: Hi to all! I just want to know if my code is right to calcute the quetelet? Thank
0
#4 Jun 28th, 2006
•
•
•
•
Originally Posted by Shadowhawk
Yes, but fflush(stdin); will do as well...
http://c-faq.com/stdio/stdinflush.html
Last edited by Dave Sinkula; Jun 28th, 2006 at 11:37 am.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Re: Hi to all! I just want to know if my code is right to calcute the quetelet? Thank
0
#5 Jul 9th, 2006
![]() |
Similar Threads
- Why won't this code work? (VB.NET)
- Tutorials & Code Submissions - Questions? (DaniWeb Community Feedback)
- Some Basic Code Hopefully (Help Needed) (HTML and CSS)
Other Threads in the C Forum
- Previous Thread: swapping
- Next Thread: pls check flowchart for errors/inefficiencies
| Thread Tools | Search this Thread |
#include * ansi array arrays asterisks bash binarysearch centimeter changingto char character convert copyimagefile cprogramme creafecopyofanytypeoffileinc createprocess() database dynamic execv fgets file floatingpointvalidation fork framework function getlogicaldrivestrin givemetehcodez grade gtkwinlinux hacking histogram ide inches include incrementoperators infiniteloop initialization input interest intmain() iso kernel keyboard kilometer km license linked linkedlist linux list lists looping lowest matrix meter microsoft number oddnumber open opendocumentformat openwebfoundation overwrite owf pdf pointer pointers posix power probleminc process program programming radix recursion recv recvblocked research reversing segmentationfault sequential single socket socketprogramming standard strchr string suggestions systemcall test testing threads turboc unix urboc user variable wab whythiscodecausesegmentationfault windowsapi






