j

Monday, 2 November 2015

Write a program that take 5 digit number and find the sum of first and last digit



#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n,a,b,sum;
cout<<"Enter 5-digit number:"<<endl;
cin>>n;
a=n/10000;
b=n%10;
cout<<"The sum of first and last digit is "<<a+b;
getch();
}


Subscribe to this Blog via Email :