| | |
Challenging Programming Question.
![]() |
Hi all
Post some challenging programming question, which are really hard to solve...
Post some challenging programming question, which are really hard to solve...
Freedom in the Mind, Faith in the words.. Pride in our Souls...
Indian Developer
http://falaque.wordpress.com/
Indian Developer
http://falaque.wordpress.com/
http://en.wikipedia.org/wiki/Integer_factorization
Fortune and glory will be yours if you can solve this one.
Fortune and glory will be yours if you can solve this one.
•
•
•
•
http://en.wikipedia.org/wiki/Integer_factorization
Fortune and glory will be yours if you can solve this one.
that's really nice, many ppl are working on that...
Freedom in the Mind, Faith in the words.. Pride in our Souls...
Indian Developer
http://falaque.wordpress.com/
Indian Developer
http://falaque.wordpress.com/
Hi
Solve this:
write a program to generate its own source code.
(plz dnt come up with solution like, reading source file, etc.)
Solve this:
write a program to generate its own source code.
(plz dnt come up with solution like, reading source file, etc.)
Freedom in the Mind, Faith in the words.. Pride in our Souls...
Indian Developer
http://falaque.wordpress.com/
Indian Developer
http://falaque.wordpress.com/
Also, generally, making quines is easy. You just have the following formula:
You'll make a program in three parts:
Part 1: If needed, make a function that prints a string once, and then prints it in the string literal notation you used to write the string, and then prints Part 3. Then in the 'main' function, pass the string you write in part 2 to this function.
Part 2: Write Part 1 in string form.
Part 3: This is the text that follows immediately after the string in Part 2.
You'll make a program in three parts:
Part 1: If needed, make a function that prints a string once, and then prints it in the string literal notation you used to write the string, and then prints Part 3. Then in the 'main' function, pass the string you write in part 2 to this function.
Part 2: Write Part 1 in string form.
Part 3: This is the text that follows immediately after the string in Part 2.
Example:
#include <stdio.h>
#include <string.h>
void f(char* s) {
char* p;
p = s;
printf("%s\"",p);
while (*p) {
if (strchr("\\\n\"", *p)) {
printf("\\%c", *p == '\n' ? 'n' : *p);
}
else {
putchar(*p);
}
++p;
}
printf("\");\n}\n");
}
int main(void) {
f("#include <stdio.h>\n#include <string.h>\n\nvoid f(char* s) {\n char* p;\n p = s;\n printf(\"%s\\\"\",p);\n while (*p) {\n if (strchr(\"\\\\\\n\\\"\", *p)) {\n printf(\"\\\\%c\", *p == '\\n' ? 'n' : *p);\n }\n else {\n putchar(*p);\n }\n ++p;\n }\n printf(\"\\\");\\n}\\n\");\n}\n\nint main(void) {\n f(");
} its nice sarehu...
Freedom in the Mind, Faith in the words.. Pride in our Souls...
Indian Developer
http://falaque.wordpress.com/
Indian Developer
http://falaque.wordpress.com/
![]() |
Similar Threads
- Programming FAQ - Updated 1/March/2005 (Computer Science)
- Suggest Please (Getting Started and Choosing a Distro)
Other Threads in the IT Professionals' Lounge Forum
- Previous Thread: problem with named anchors in firefox
- Next Thread: Html/j2sdk
Views: 1734 | Replies: 7
| Thread Tools | Search this Thread |
Tag cloud for IT Professionals' Lounge
1gbit advice amazon answers archive british broadband business businessprocesses career carrier censorship cern china collectiveintelligence connectivity consumer consumers corporateearnings css datatransfer debtcollectors dictionary digg digital ebay ecommerce email employment environment facebook government grid high-definition hottub infodelivery infotech intel internet interview ipod isp japan kindle lhc library malware marketing mit moonfruit news onlineshopping php piracy piratebay pope porn program r&d religion remoteworking research retail schools sex shopping simple skype smallbusiness smb sms socialmedia socialnetworking softwareengineer spam speed spending ssl startrek statistics stocks study stumbleupon survey tabletpc technology touch-screen touchscreen training twitter uk vbulletin videoinprint voips vulnerability web webdesign webdeveloper windows words






