#include"iostream.h"
#include"conio.h"
#include"math.h"
int main()
{
int count=0;
char c;
char name[20];
clrscr();
cout<< "\n\n-------------Get() & put() Function--------\n\n";
cout<< "INPUT Text\n";
cin.get(c);
while(c!='\n')
{
cout.put(c);
count++;
cin.get(c);
}
cout<< "\n\n No. of characters="<< count <<"\n";
cout<<"\n\n-------Getline() & Write Function()-------\n\n";
cout<<"Enter name\n";
cin.getline(name,10);
cout<<"Printing name with Write() size 5 characters \n\n";
cout.write(name,5);
cout<< "\n\n------------Width() Dunction--------\n\n";
cout<< "ITEMS";
cout.width(8);
cout<< "COST";
cout.width(15);
cout<<"Total Value"<<"\n";
cout<<"\n\n-------Precision() Function--------\n";
cout.precision(5);
cout<< sqrt(3) << "\n";
cout<< "\n\n------Fill() Function \n";
cout.fill('$');
cout.width(15);
cout<< "SAI";
getch();
return 0;
}
Monday, November 2, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment