Welcome

Hi! This blog is for beginners of c++ and java .You can check and pick codes for your programming assignments. This will also help you to understand the concepts of these programming languages. Its all about programming.

Basic functions

Sunday, May 15, 2011


#include<iostream>
using namespace std;
#include<conio.h>
void sum(void);//function prototype
void dif(int, int);

void main()
{int c,d;
cout<<"enter 2 no of which u want a difrnc"<<endl;
cin>>c>>d;
dif(c,d);//function calling
cout<<"back in main\n";


_getch();

}
void sum()//function defination
{
int c,d;
int sum=0;
cout<<"enter 2 no"<<endl;
cin>>c>>d;
sum=c+d;
cout<<"sum is ="<<sum<<endl;

}
void dif(int c, int d)
{
int difr=0;
difr=c-d;
cout<<"difrence is "<<difr<<endl;
sum();
cout<<"back in diff fun\n";
}