28
Example 1 : First #include<iostream.h> int main() { cout<<"Hello\n"; return(0); } Example 2 : Program to illustrate Arithmetic Operators # include <iostream.h> int main( ) { int a =54, b = 20 ; // Dynamic initialization cout <<" \n a = "<<a<<" and b = "<<b ; cout<<" \n a + b = " << a+b ; // 54 + 20 cout<<" \n a - b = " << a - b ; // 54 - 20 cout<<" \n a * b = " << a * b ; // 54 * 20 cout<<" \n a / b = " << a / b ; // 54 / 20 cout<<" \n a % b = " << a % b ; // 54 % 20 return 0; } Example 3 : Program to illustrate Associative law for Arithmetic Operators # include <iostream.h> int main( ) { int a, b, c, d, e, f; a = 5, b = 2 ;

Object Oriented Programming Chapter 1

Embed Size (px)

DESCRIPTION

Object Oriented Programming Simple Programmes

Citation preview

/* Program to illustrate Arithmetic Operators */

Example 1 : First

#include

int main()

{

cout