Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 31st, 2005, 11:58 AM   #1
shagan
Newbie
 
Join Date: Mar 2005
Posts: 2
Rep Power: 0 shagan is on a distinguished road
crack these questions if u can!!!

Crack these ques if u can and mail to shagan_glare@yahoo.com
Handsome prizes waiting !!!
send prog as soon as u finish each. Points will get accumulated
to find the max scorer
(contest closes on 1 apr 12 pm)

1.Write a program to find rightmost non-zero digit from a factorial of any number without actually calculating the factorial.

(2). Write the shortest C function that takes an int as argument and returns an int with all the bits of the argument reversed, i.e. the ith bit of the result is the (w-i)th bit of the argument, where w is the width of an int in bits.

The function must not make any assumptions about the size of int or char (i.e. it must work for arbitrary widths).

(3) Find and list all four-digit numbers in decimal notation that have the property that the sum of its four digits equals the sum of its digits when represented in hexadecimal (base 16) notation and also equals the sum of its digits when represented in duodecimal (base 12) notation.
For example, the number 2991 has the sum of (decimal) digits 2+9+9+1 = 21. Since 2991 = 1*1728 + 8*144 + 9*12 + 3, its duodecimal representation is 189312, and these digits also sum up to 21. But in hexadecimal 2991 is BAF16, and 11+10+15 = 36, so 2991 should be rejected by your program.
The next number (2992), however, has digits that sum to 22 in all three representations (including BB016), so 2992 should be on the listed output. (We don’t want decimal numbers with fewer than four digits — excluding leading zeroes — so that 2992 is the first correct answer.)
(4). A word chain is a daisy chain made from words. Two words, w1 and w2, may be linked if the last letter of w1 is the same as the first of w2. E.g. ‘bar’ and ‘red’ may be linked. You must form a word-chain from a list of words that you are given. The word-chain must
1. Consist of four words
2. be circular (i.e. the last word should link to the first word)
No word may be used more than once.
Example
Enter the list of words : 5
gap pet big tab tar
A four word chain is : big-gap-pet-tab







(5). You are required to write a program in C to generate a pattern
as shown below.
*
$ *
# $ *
* # $ *
# $ *
$ *
*

To generate the above pattern, you are required to take the characters to be displayed as input from the user.
The first character would form the central symbol; the second would be the symbol on the left side of the central symbol and so on.
For the above pattern the input sequence would be *$#a.
(6). to open a safe requires knowing three single digits (1-9). For example, the three digits 5 - 4 - 9 is a valid combination. A secret message has been found that gives clues about the combination to the safe.
1. The digit 1 is not used.
2. All of the digits are different.
3. The first digit plus 3 times the second digit plus 5 times the third
digit is the same number as the product of all three digits.
Using these clues write a program to crack the safe.
Sample Run
THE COMBINATION IS ?-?-?





(7). FRIDAYS IN 1990
What are the dates of all Fridays in 1990? Write a program that will find the dates of all Fridays in 1990. Print the dates in the form shown in the sample run.
You need to know the following.
1. The first Friday in 1990 occured on the 5th of January.
2. Thirty days has September, April, June, and November, all the rest have 31 except for February which has 28 except in leap years when it has 29.
3. 1990 is not a leap year.
Note: To make it fair for everyone, you may not use any built-in date functions from your computer language.
Ex:
The Fridays in 1990 occur on:
1/5, 1/12, 1/19, 1/26
2/2, 2/9, 2/16, 2/23
3/2, 3/9, 3/16, 3/23, 3/30
4/6, 4/13, 4/20, 4/27
.......................
12/7, 12/14, 12/21, 12/28

(8).Write a c program to print the given number into words.(upto 99,99,99,999)
For ex. 223
two hundred twenty three
(9). WORD CHAIN
A Word Chain is a sequence of words which differ by one letter. The following sequence is a word chain
MOM MOP MAP TAP TOP TOW
because each adjacent word differs by exactly one letter. Write a program that accepts a sequence of words and tests whether it is word chain.

Test your program with the sequence HEAL, HEAD, DEAD, DEED, DEER, BEER and the sequence
TWO, TOO, TOP, PIP, POP. After
each sequence print whether it is or is not a word chain.[you may enter your words in the program in DATA statements ]
Sample Run
MOM MOP MAP TAP TOP TOW is a word chain.
TWO TOO TOP PIP POP is not a word chain.
(10). Write a program to generate solutions for crossword puzzles.
The program will first accept words that must be placed horizontally (maximum 3) and words that must be placed vertically (maximum 3). The words must interlink in the same way that a crossword designer would place them. If The spots where there are no letters, must be filled this star (*). Convert all letters to uppercase. These are the rules to calculate the penalty points for your solution.
Number of points in the puzzle.
4 times the number of letters that touch each other but do not make up one of the words entered.
If a word is not placed in the puzzle, the penalty is 5 times the number of letters in the word. (It may be to your advantage not to place a word.)
At least half the words entered must be interlinked for the solution to be considered valid.
INPUT
Up to 6 words, the first 3 to be placed horizontally, the next three being placed vertically.
OUTPUT
The program must display a rectangle representing the crossword puzzle. You must show at least 2 different solutions and the penalty associated with them. The lower the penalty for your best solution, the higher will your marks be compared to other competitors.
SAMPLE RUN
Crosswords

Enter horizontal word: HELLO
Enter horizontal word: loaf
Enter horizontal word: (no word entered)
Enter vertical word: Elf
Enter vertical word:
Enter vertical word:

HELLO Penalty (3 * 5 + 4 * 6 + 5 * 0) = 39
*LOAF (LA, LA and OF were not entered)
*F***

HELLO Penalty (3 * 5 + 4 * 0 + 5 * 4) = 35
*L*** (LOAF was not placed,
*F*** but more than half the words interlinked)

**HELLO Penalty (3 * 7 + 4 * 0 + 5 * 0) = 21
***L*** BEST SOLUTION
LOAF***

Again (y/n) N


(11). Code Generation
Your employer needs a backend for a translator for a very SIC machine (Simplified Instructional Computer, apologies to Leland Beck). Input to the translator will be arithmetic expressions in postfix form and the output will be assembly language code.
The target machine has a single register and the following instructions, where the operand is either an identifier or a storage location.
L -- load the operand into the register
A -- add the operand to the contents of the register
S -- subtract the operand from the contents of the register
M -- multiply the contents of the register by the operand
D -- divide the contents of the register by the operand
N -- negate the contents of the register
ST -- store the contents of the register in the operand location
An arithmetic operation replaces the contents of the register with the expression result. Temporary storage locations are allocated by the assembler for an operand of the form "$n" where n is a single digit.
Input and Output
The input file consists of several legitimate postfix expressions, each on a separate line. Expression operands are single letters and operators are the normal arithmetic operators (+, -, *, /) and unary negation (@). Output must be assembly language code that meets the following requirements:
1.One instruction per line with the instruction mnemonic separated from the operand (if any) by one blank.
2.One blank line must separate the assembly code for successive expressions.
3.The original order of the operands must be preserved in the assembly code.
4.Assembly code must be generated for each operator as soon as it is encountered.
5.As few temporaries as possible should be used (given the above restrictions).
6.For each operator in the expression, the minimum number of instructions must be generated (given the above restrictions).
Input AB+C/
Output:
L A
A B
D C


(12). Let n be any positive integer, and let b be an integer greater than or equal to 2. Write a C program to generate the complete base-b expansion of n.
Input: Input is a sequence of pairs of integers, n and b, followed by a pair of zeroes. Each value for n will be positive, and each value for b will be greater than or equal to 2.
For ex. Input is 20000 3
Output:
2
3 3+2 3 2
20000 = 3 +3 +2*3 +2*3 +2
shagan is offline   Reply With Quote
Old Mar 31st, 2005, 12:14 PM   #2
shagan
Newbie
 
Join Date: Mar 2005
Posts: 2
Rep Power: 0 shagan is on a distinguished road
Its abt time !

Its NOT Home work Guys

Ur efficiency of The code is getting TESTED.
Ur code will be compiled by Our Code Checker.
And points will be given accord to std criterias

Time put up was INDIAN (IST).

U have got 12 hrs to go from now
(thats when this post gets posted)

Ps: First register to the id with ur present Address
Mention your username in "Subject"

Thanx
Shagan
<INDIAN INFOTECH LTD>
shagan is offline   Reply With Quote
Old Mar 31st, 2005, 1:06 PM   #3
peace_of_mind
Professional Programmer
 
peace_of_mind's Avatar
 
Join Date: Sep 2004
Location: Hell if I know most of the time
Posts: 435
Rep Power: 4 peace_of_mind is on a distinguished road
Send a message via MSN to peace_of_mind Send a message via Yahoo to peace_of_mind
Who's doing this "contest"? What company/group/etc? No explanation as to who you are or why you're posting this here. Prizes like what? How are points being accumulated? By whom? You sound a bit like a used car salesman, frankly.

[EDIT] Did you rate your own thread? lol [/EDIT]
__________________
Amateurs built the ark
Professionals built the Titanic


Last edited by peace_of_mind; Mar 31st, 2005 at 1:14 PM.
peace_of_mind is offline   Reply With Quote
Old Mar 31st, 2005, 1:38 PM   #4
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
no time to partake in something like this... unless $$$ was involved, and lots of it.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Mar 31st, 2005, 1:56 PM   #5
peace_of_mind
Professional Programmer
 
peace_of_mind's Avatar
 
Join Date: Sep 2004
Location: Hell if I know most of the time
Posts: 435
Rep Power: 4 peace_of_mind is on a distinguished road
Send a message via MSN to peace_of_mind Send a message via Yahoo to peace_of_mind
The fact that he needed to include the line, "Its NOT homework Guys", along with the fact that the deadline happens to be April 1st has me a bit wary.
__________________
Amateurs built the ark
Professionals built the Titanic

peace_of_mind is offline   Reply With Quote
Old Mar 31st, 2005, 3:45 PM   #6
Benoit
Expert Programmer
 
Benoit's Avatar
 
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 548
Rep Power: 4 Benoit is on a distinguished road
Yeah man whats up with that? He comes here and his first post is a "contest". Please give me the details of who is hosting this contest and I might give it a try
__________________
Johnny was a chemist's son but Johnny is no more, for what Johnny thought was H2O was H2SO4
Benoit is offline   Reply With Quote
Old Mar 31st, 2005, 4:27 PM   #7
Overmind
Professional Programmer
 
Overmind's Avatar
 
Join Date: Jun 2004
Location: South Africa, Johannesburg
Posts: 301
Rep Power: 5 Overmind is on a distinguished road
Talking

Quote:
Originally Posted by shagan
Its NOT Home work Guys

Ur efficiency of The code is getting TESTED.
Ur code will be compiled by Our Code Checker.
And points will be given accord to std criterias

Time put up was INDIAN (IST).

U have got 12 hrs to go from now
(thats when this post gets posted)

Ps: First register to the id with ur present Address
Mention your username in "Subject"

Thanx
Shagan
<INDIAN INFOTECH LTD>
You are very creative in making up bullshit.
__________________
[SIGPIC][/SIGPIC]
Overmind is offline   Reply With Quote
Old Mar 31st, 2005, 6:04 PM   #8
Benoit
Expert Programmer
 
Benoit's Avatar
 
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 548
Rep Power: 4 Benoit is on a distinguished road
//Line from I-Robot

*sneezes*

Oh sorry I'm allergic to bullshit
__________________
Johnny was a chemist's son but Johnny is no more, for what Johnny thought was H2O was H2SO4
Benoit is offline   Reply With Quote
Old Mar 31st, 2005, 6:29 PM   #9
Donald Ferrone
Newbie
 
Donald Ferrone's Avatar
 
Join Date: Mar 2005
Posts: 19
Rep Power: 0 Donald Ferrone is on a distinguished road
Send a message via MSN to Donald Ferrone
Thanks for giving me a decent problem for the weekend! I'll hopefully post well-documented source for your problems in this thread within the next few days to a week.

Cheerio!
Donald Ferrone is offline   Reply With Quote
Old Mar 31st, 2005, 7:36 PM   #10
peace_of_mind
Professional Programmer
 
peace_of_mind's Avatar
 
Join Date: Sep 2004
Location: Hell if I know most of the time
Posts: 435
Rep Power: 4 peace_of_mind is on a distinguished road
Send a message via MSN to peace_of_mind Send a message via Yahoo to peace_of_mind
Forgive the tangent, Donald, but what is up with your site?
__________________
Amateurs built the ark
Professionals built the Titanic

peace_of_mind is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:50 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC