|
|
. |
|
C
For Swimmers : Mastering C step-by-step |
|
|
|
Programming
Problems - I
|
|
Description
|
Size
|
|
Write a program (W.A.P.) in C to SWAP
the contents of 3 variables without using the temporary (or
extra) variables.
|
1Kb
|
|
W.A.P. in C to find the Fifth
root of the sum of the squares of the first 100 ODD
numbers only.
|
1Kb
|
|
W.A.P. in C to multiply
any two numbers without using * (asterisk)
[Hint : Use BITWISE OPERATORS]
|
1Kb
|
|
W.A.P. in C to check whether
given number x is equal to the value 2 POWER i or
something. [Hint: where i>=0 using BITWISE
operators ONLY.]
|
1Kb
|
|
W.A.P. in C to maintain
2 STACKS within a SINGLE ARRAY and the values
of one stack should not overwrite the values of another
stack.
|
2Kb
|
|
W.A.P. in C that act as a guessing
game in which the user has eight tries to guess
a randomly generated number. The program will tell the
user each time whether he guessed high or low. The user
WINS the game when the number guessed is same as randomly
generated number.
|
2Kb
|
|
W.A.P. to determine how much money is in a piggy bank that
contains several 50 paise coins, 25 paise coins, 20 paise
coins, 10 paise coins and 5 paise coins. Use the following
values to test your program : Five 50 paise coins, Three
25 paise coins, Two 20 paise coins, One 10 paise coin and
Fifteen 5 paise coins. (Answer : Rs. 4.50)
|
1Kb
|
|
Modify the program to accept total amount (in rupees) and
convert them into paise.
|
1Kb
|
W.A.P. in C to determine how many
of the characters are vowels and how many are consonants
in a given line of text. Also terminate the
string when the input character encountered is other than
the alphabets(a-z or A-Z) and Blank spaces.
[Hint:(a) When the input string is 'C FOR SWIMMERS, TEST
YOUR C PROGRAMMING STRENGTHS'. Consider the string 'C FOR
SWIMMERS' only Because ',' is encountered. (b) When the
input string is 'Y2K PROBLEM'. Consider the character 'Y'
only Because the '2' is encountered.]
|
1Kb
|
|
W.A.P. in C to perform 4-letter
WORD UNSCRAMBLING i.e. List all possible
combinations of 4-letters in a word. Ex: The word 'TEST'
can be unscrambled as TEST,TETS,TSET,TSTE,TTSE,TTES,etc.
|
1Kb
|
| Watch
out for more...
|
|
Code contributors will be
highly appreciated and acknowledged. Send your feedback about
Programming Problems section to nandakishorkn@rediffmail.com
|
|
|
|
|
You are
Visitor No. 
Sign
my Guestbook
View
my Guestbook
Thanks for using C For Swimmers.
Regarding this material, you can send Bug Reports,
Suggestions, Comments, etc. to
nandakishorkn@rediffmail.com
|
|
|
Note: All
logos or trademarks are related to their respective owners.
Although every
precaution has been taken, the designer(s) owe no responsibility
for malicious errors.
No liability assumed
for damages resulting from the use of the available information.
|