Write a program in the c language which give output as binary code of the source file?

Showing Answers 1 - 3 of 3 Answers

//      PROGRAM which prints itself
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<fstream.h>
void main()
{
char ch;
clrscr();
fstream fout;
fout.open("itself.c",ios::in);
if(!fout)
{
printf("n cant open");
exit(0);

}
while(ch!=EOF)
{
ch=fout.get();
cout<<ch;
}

fout.close();

}



//the file name is itself.c

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions