===========================================================================
CODING
#include<conio.h>
#include<iostream.h>
#include<math.h>
void main()
{
clrscr();
int b,c,d,e;
long a,q;
cout<<"Enter any four digit number:- ";
cin>>a;
b=a%10;
a=a/10;
c=a%10;
a=a/10;
d=a%10;
a=a/10;
e=a%10;
q=b+e;
cout<<"\n The sum of first and last number is:- "<<q;
getch();
}
CODING
#include<conio.h>
#include<iostream.h>
#include<math.h>
void main()
{
clrscr();
int b,c,d,e;
long a,q;
cout<<"Enter any four digit number:- ";
cin>>a;
b=a%10;
a=a/10;
c=a%10;
a=a/10;
d=a%10;
a=a/10;
e=a%10;
q=b+e;
cout<<"\n The sum of first and last number is:- "<<q;
getch();
}
===========================================================================
No comments:
Post a Comment