473,320 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Write C program

Hello friends.

"Write a C program such that the output is source code itself"

Aug 23 '07 #1
6 1646
On Aug 23, 8:48 pm, anantsha...@gmail.com wrote:
Hello friends.

"Write a C program such that the output is source code itself"
#include <iostream>
int main()
{
std::cout << "source code itself" << std::endl;
}
Alternatively, google quine.

-N

Aug 23 '07 #2
On Aug 23, 8:59 pm, Neelesh Bodas <neelesh.bo...@gmail.comwrote:
On Aug 23, 8:48 pm, anantsha...@gmail.com wrote:
Hello friends.
"Write a C program such that the output is source code itself"

#include <iostream>
int main()
{
std::cout << "source code itself" << std::endl;

}

Alternatively, google quine.

-N
BTW, this is a C++ program. For a C program, contact appropriate
newsgroup.

-N

Aug 23 '07 #3
On Aug 23, 10:48 am, anantsha...@gmail.com wrote:
Hello friends.

"Write a C program such that the output is source code itself"
Not sure why this is important. However, one can simply write a
program that opens up the source file and outputs it.

Aug 23 '07 #4
On Aug 23, 9:48 am, anantsha...@gmail.com wrote:
Hello friends.

"Write a C program such that the output is source code itself"
You mean a quine, right? There's lots of those out
there.

Aug 23 '07 #5
ja************@gmail.com wrote:
On Aug 23, 10:48 am, anantsha...@gmail.com wrote:
Hello friends.

"Write a C program such that the output is source code itself"

Not sure why this is important. However, one can simply write a
program that opens up the source file and outputs it.

A solution that works rather poorly when the source file is not
available.


Brian
Aug 23 '07 #6
On Thu, 23 Aug 2007 08:48:20 -0700, anantshayan wrote:
Hello friends.

"Write a C program such that the output is source code itself"
It's called a "Quine".

--
Obnoxious User
Aug 25 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: Nick Evans | last post by:
Hello there, I have been on and off learning to code (with python being the second language I have worked on after a bit of BASIC). What I really want to know is, if you are going to actually...
6
by: rxl124 | last post by:
someone please please help w/ this one. As I been working on this on and off and it just does not want to work. 1 #!/usr/bin/perl -w 2 3 $file = "/home/user1/dothis"; 4 open(FILE, ">$file");...
8
by: Zheng Da | last post by:
I don't know where should I ask the question, so send the email to this group. I choose this group, because I want to write the program with c++ :) I want to write a program which support...
24
by: gswork | last post by:
Let's write a c program, without knowing what it does... Some of you may recall Jim Roger's excellent series of posts (on comp.programming) exploring the implementation of common software...
24
by: Charles Ulrich | last post by:
Greetings, I hope my greenness isn't showing too bad by asking this, but I ran across this trivial program today that left me flabbergasted: #define MESSAGE "This account is currently not...
18
by: jacob navia | last post by:
In C, we have read-only memory (const), read/write memory (normal data), and write only memory. Let's look at the third one in more detail. Write only memory is a piece of RAM that can only...
4
by: Break2 | last post by:
I am trying to write a simple program which asks a user to enter 5 integers after which the average will be computed and written to the screen. That simple. However I want to do it according to a...
1
by: Sachin Garg | last post by:
I have a program which opens a fstream in binary input+output mode, creating the file if it doesn't exists. But writing doesn't works after reading, it must be something obvious that I am not aware...
5
by: Jon Skeet [C# MVP] | last post by:
On Sep 9, 9:41 am, raylopez99 <raylope...@yahoo.comwrote: It's tricky in .NET for two reasons: 1) LINQ doesn't have any concept of "remove" 2) List<T>.RemoveAll doesn't pass in the index...
11
by: 960392954 | last post by:
The Towers of Hanoi is a famous problem about moving a certain number of disks from one peg to another.I write a recursive program for it.If you have known it ,you can skip the program. #include...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.