GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 205 of 255    Print  
Write a program in the c language which give output as binary code of the source file?

  
Total Answers and Comments: 1 Last Update: April 25, 2008     Asked by: sunny 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
April 25, 2008 13:50:24   #1  
ahmedmujeeb318 Member Since: October 2007   Contribution: 1    

RE: Write a program in the c language which give output as binary code of the source file?
//      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

 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : All the solutions above are reading the source code with the files concepts.find a solution where you do not have a source file to read the contents.There is a macro or an attiribute which tells the compiler the name of the program, function or the attribute. ...

Latest Answer : Here is my solution:#include #include #include using namespace std;string toBinary(unsigned int num){  stringstream s;  for(int i=0; i

Latest Answer : In C it is System("program_to_run.exe"); In Windows it can be ShellExecute(); or WinExec(); ...

Latest Answer : In Linux/Unix , we have the header file dirent.h.This .h file contains the direcory manipulation functions Some of the functions are opendir,closedir,readdir. ...

Latest Answer : it will give last initialize value..suppose you write ..int x=10;printf("%d");then it prints 10;if not initialize then print a garbage value.. ...

Latest Answer : #include main(int argc, char *argv[]){  printf("Removing: %s...n", argv[0]);  remove(argv[0]);} ...

Latest Answer : Yes, Just Put it in an  unsigned int Bin_data[] {0x0h, 0x0f......... ............ } ...

Latest Answer : 7150u have to worry because this is a master program i had created when i started with c ...

Latest Answer : You can write Multithreading application by using POSIX library of Linux ...

Latest Answer : typedef enum {read,blue,green}color; void main() { color a = 1;    // Error in C++} ...


 Sponsored Links

 
Related Articles

jQuery Table Row Finished Code

jQuery Table Row Finished Code The Finished Code Our second example page has demonstrated table row striping highlighting tooltips collapsing expanding and filtering Taken together the JavaScript code for this page is mosgoogle geshibot lang php&quot; document ready function var highlighted
 

jQuery Interacting with Other Code

jQuery Interacting with Other Code We learned with our sorting and paging code that we can t treat the various features we write as islands The behaviors we build can interact in sometimes surprising ways; for this reason it is worth revisiting our earlier efforts to examine how they coexist with t
 

jQuery Completed sorting and paging code

Learning jQuery The Finished Code The completed sorting and paging code in its entirety follows mosgoogle geshibot lang php&quot; fn alternateRowColors function tbody tr odd this removeClass even addClass odd ; tbody tr even this removeClass odd addClass even ; return this; ; document
 

code

geshibot lang javascript&quot; head This is a JS snippet from Geshi Bot&quot; Replaces the geshi default classes with mambo joomla classes function replaceGeshiWithMamboClasses if document document getElementsByTagName Category
 

OOPS Tutorials

Object oriented programming OOP is a computer science term used to characterize a programming language that began development in the 1960&rsquo; s The term object oriented programming&rsquo; was originally coined by Xerox PARC to designate a computer application that describes the methodol
 

C++ Standard Input Output Stream

C Standard Input Output Stream In this C tutorial you will learn about standard input stream and standard output stream explained along with syntax and examples C programming language uses the concept of streams to perform input and output operations using the keyboard and to display information on
 

What is Data File

In a logical data model, the conceptual data model which is based on the business semantic is being defined. Thus, entities and relationships and corresponding table and column design, object oriented classes, and XML tags, among other things are being laid regardless of the database will be physica
 

How to develop compile and run a C program

The steps involved in building a C program are: 1. First program is created by using any text editor and the file is stored with extension as .c 2. Next the program is compiled. There are many compilers available&nbsp;like GNU C compiler called as gcc, Sun compiler, Borland compiler which is pop
 

Language Enhancements in SQL Server 2005

The T-SQL has been enhanced to include error handling, recursive query and to support the new database engine capabilities. Two new relational operators have been introduced&mdash;PIVOT and UNPIVOT for use in the FORM clause query. They perform manipulation on an input table valued expression an
 

NLP Language Hierarchy and Thinking Continuum

NLP Language Hierarchy and Thinking Continuum Introduction We use words as tools for putting forth our ideas explaining concepts or expressing feelings and emotions The words we use can be extremely specific in nature or most general or can be in the continuum in between Neuro linguistic Programming
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape