Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
does anybody know how to do this in c language? or to look for its formula? tnx alot,,
Yes, many of us know how to do this. The question is: do you? Or can you figure it out?
If you need help, asking specific questions and posting code you've tried will get excellent answers.
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
TRY THIS OUT
goutham, around here we want the poster to find the answer. We help them with their code, we don't do their homework for them.
stringgader, read the above. In order to get this problem from your instructor, you must know something about code. This can't possibly be your first program.
by the way,, im only new to this programming thing,, tnx again
Duh, really? ;)
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
no i cant, thats why im asking for someone hu can help me do thiis ,, its actually a problem,, twas given by our instructor and wants us to figure it out,, thats why ide like to gather any idea or information regarding this thing,,, tnx for the reply...
Go back and read the thread link that I posted, it contains the answer to your problem. If you don't understand the posted code to that thread then I doubt you are ready for the course you are taking. The proglem is a little too advanced for someone completly new to programming and C language in particular.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
@ stringgader. The code that goutham_see posted for you, works very well. Why don't you compare his with yours and learn what is not working with yours?.
In your last post I see that you make the declaration of variables ALL Global. I don't think that's what you want even when is going to work. What you want to do is to declare them after the left bracket in main, in this case.
The function:
clrscr(); is not necesary there. Is not doing anything for your, and above anything else, it makes your code not portable, which is something that you should always shoot for.
Same withgetche(); your could very well use the standard getchar().
Aia
Nearly a Posting Maven
2,392 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 218