[Show all top banners]

sssg
Replies to this thread:

More by sssg
What people are reading
Subscribers
:: Subscribe
Back to: Kurakani General Refresh page to view new replies
 Some C program help needed
[VIEWED 1500 TIMES]
SAVE! for ease of future access.
Posted on 11-12-04 4:18 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Write a function that takes an integer value and returns the number with its digits reversed. For example, given the number 7631, the function should return 1367.

===============================================================


Write a program that plays the game of ?guess the number? as follows: Your program chooses the number to be guessed by selecting an integer at random in the range 1 to 1000. The program then displays the following:

I have a number between 1 and 1000
Can you guess my number?
Please type your first guess.

The player then types a first guess. The program responds with one of the following:

1. Excellent! You guessed the number!
Would you like to play again (y or n)?
2. Too low. Try again.
3. Too high. Try again.

If the player?s guess is incorrect, your program should loop until the player finally gets the number right. Your program should keep telling the player Too high or Too low to help the player ?zero in? on the correct answer.

===============================================================


Use a single-subscripted array to solve the following problem. A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9 percent of the $5000, or a total of $650. Write a program (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson?s salary is truncated to an integer amount):
a) $200-$299
b) $300-$99
c) $400-$499
d) $500-$599
e) $600-$699
f) $700-$799
g) $800-$899
h) $900-$999
i) $1000 and over

 
Posted on 11-12-04 10:08 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

sssq bro, hint dim??
for part1:
lets say you have initialized
int a, b, c;
a = 7631;
while a is greater than zero
b = a/10 makes b = 763
c = a%10 gives c = 1 (last digit of 7631)
a = b; (now a is 763)
print c
end while loop.
I am sure it will work.

For part 2:
Check this thread. Echoes bro has already done that program.
- http://www.sajha.com/sajha/html/openthread.cfm?forum=2&ThreadID=17523&show=all#94784

enjoy programing. :P
 
Posted on 11-12-04 7:04 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

kayho saab ko assignment same po raicha?i got that one in java anyone wants?;oP i think i deleted it :oS hehe..anyways echoes bro ka cha ni ;o)...

kalanki bro ...C tutoring centre kholney bichar cha?u and me partner ni..we take ppl in and when they need help..we redirect them to echoes bro ;o)...

kasto lagyo plan?ideas ta ma nikalney ma ramro chu ni(i think i am..or am i gettn too thik?;oP) gaarney ma chai..hyaa...are u the gaaring type?i think u are..;o) partnership??hehe

anyways hope ur enjoyin ur programmin...im not hehe...urghh...katti dherai language ho!! nepali na janey ra tauko tension!ani urghh....hehe

happy tihar...oho dyam now im thinking a program to come out with all the bhoilo verses!dyam any company lookin for a person like me?;oP

laters

danny
 
Posted on 11-15-04 4:19 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

thank you KALANKISTHAN bro - if I need more I will have to email you I guess. Yes dananah bro you can open a site for that many will need help.
 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 200 days
Recommended Popular Threads Controvertial Threads
शीर्षक जे पनि हुन सक्छ।
NRN card pros and cons?
What are your first memories of when Nepal Television Began?
TPS Re-registration
TPS Re-registration case still pending ..
Democrats are so sure Trump will win
Basnet or Basnyat ??
nrn citizenship
Sajha has turned into MAGATs nest
Nas and The Bokas: Coming to a Night Club near you
ChatSansar.com Naya Nepal Chat
डीभी परेन भने खुसि हुनु होस् ! अमेरिकामाधेरै का श्रीमती अर्कैसँग पोइला गएका छन् !
3 most corrupt politicians in the world
अमेरिकामा बस्ने प्राय जस्तो नेपालीहरु सबै मध्यम बर्गीय अथवा माथि (higher than middle class)
if you are in USA illegally and ask for asylum it is legal
Travelling to Nepal - TPS AP- PASSPORT
emergency donation needed
Top 10 Anti-vaxxers Who Got Owned by COVID
आज बाट तिहारको सेल सकियो
निगुरो थाहा छ ??
Nas and The Bokas: Coming to a Night Club near you
Mr. Dipak Gyawali-ji Talk is Cheap. US sends $ 200 million to Nepal every year.
Harvard Nepali Students Association Blame Israel for hamas terrorist attacks
TPS Update : Jajarkot earthquake
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters