Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 19-08-2009
Member
 
Join Date: Jul 2009
Posts: 2
Executing Machine Language

I am currently learning c++. As newbie it is hard to remember all the codes and string values in it. anyhow i wrote a small program which allows a user to calculate a average of a number. So here i need so proper tips to execute a program. it should not pop up error but atleast give a simple average by calculation 3 numbers...????
Reply With Quote
  #2  
Old 19-08-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: Executing Machine Language

WHAT IS MACHINE LANGUAGE?
Although programmers tend to use C or C++ or Pascal these days, the language closest to the PC hardware is machine language. Not one second during a PCS powered on lifetime passes where the computer is not executing machine language.
Reply With Quote
  #3  
Old 19-08-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: Executing Machine Language

The equipment speaks in terms of the bits and bytes that we often spoke - like machine language. Therefore, with the purpose of to cause that its equipment executes its install program, instead of to limit itself to show them in the screen in its word processor, we must turn the source code that you wrote in English in the machine language that the computer can understand. There are two ways to do this - Compilers and Interpreters.
Reply With Quote
  #4  
Old 19-08-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: Executing Machine Language

Here is the Example :

Code:
#include <iostream.h>

int main(void)
{

int count;
float sum, number, avg;

sum = 0.0;
count = 0;

cout << endl << endl
<< endl << "Enter a number. Enter a zero (0) when you have"
<< endl << "finished entering numbers and want to compute the"
<< endl << "average of the inputted numbers." ;

do {
cout << endl << endl << "Data element #" << count + 1
<< ": ";

cin >> number;

if (number != 0.)
sum = sum + number;
count = count + 1;

} while (number != 0.0);

averg = sum / (count-1);
cout << endl << "The average is: " << avg
<< endl << endl ;
return 0;
}
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Executing Machine Language"
Thread Thread Starter Forum Replies Last Post
Need to put ACOG scope on machine gunner's M249 and machine gun class weapons in Operation Flashpoint: Red River. Tyee Video Games 5 11-06-2011 10:26 PM
Virtual machine cannot access a share on the host machine using Hyper-V Crista Operating Systems 5 22-08-2010 02:40 AM
Executing a exe from adobe air ?? Shawn-Roger Windows Software 3 01-07-2010 05:34 PM
Dvd shrink 3.2 not executing Aandaleeb Windows Software 4 27-11-2009 05:45 PM
Win32 install error "for a machine type other than current machine KaSaRa Windows x64 Edition 3 10-05-2007 09:03 PM


All times are GMT +5.5. The time now is 02:53 AM.