SEARCH THE BLOG

Friday, February 1, 2013

C++ PROGRAMS


// operating with variables

INPUT-           


#include <iostream.h>


int main ()
{
// declaring variables:
int a, b;
int result;


// process:
a = 5;
b = 2;
a = a + 1;
result = a - b;


// print out the result:
cout << result;


// terminate the program:
return 0;
}

OUTPUT-  
           4




Related Posts:

  • C++ PROGRAMS // operating with variables INPUT-            #include <iostream.h> int main () { // declaring v… Read More
  • C++ program Probably the best way to start learning a programming language is with a program. So here is our first program: // my first program… Read More
  • C++ PROGRAM              // my second program IN C++               IN… Read More
  • FORLOOP            Example of countdown using a forloop. // countdown using a for loop INPUT- #include <iostream.h… Read More
  • WHILE LOOP For example, we are going to make a program to count down      using a while loop: // custom countdown using while INPUT- … Read More

0 comments:

Post a Comment