Saturday, 18 August 2012

c++ program of adding 1st digit to last digit


add 1st digit and last digit
#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
int i,j,n,a,b,c,d;
cout<<"enter the 4 digit no";
cin>>n;
a=n%10;
b=(n/1000)%10;
i=a+b;
cout<<i;
getch();
}

No comments:

Post a Comment