Showing posts with label aDDITION OF tWO NUMBER Using Class. Show all posts
Showing posts with label aDDITION OF tWO NUMBER Using Class. Show all posts

Monday, 29 October 2012

Program Of Reverse String In C++

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
 
main()
 
{
 
clrscr();
 
char x[20];
 
int l;
 
//cout<<"Enter String=";
 
//cin>>x;
 
gets(x);
 
reverse(x);
 
getch();
 
}
 
{
 
int p=0,i;
 
for(i=0;a[i]!='\0';i++)
 
{
 
p++;
 
}
 
{
 
cout<<a[i];
 
}
 
}

Sunday, 15 January 2012

Program Of Addition Of Two Numbers Using Class In C++

    #include<iostream.h>
    #include<conio.h>
   
 class pawan
      {
private:
int x,y;
public:
void getdata(int p,int q)
{
x=p;
y=q;
}
void display()
     {
int z;
z=x+y;
cout<<z;
     }
     };

main()
{
pawan a1;
int a,b,c;
cout<<"entaer numbers=";
cin>>a>>b;
a1. getdata(a,b);
a1.display();
getch();
}