Professional Documents
Culture Documents
OOPS Few Programs With Output
OOPS Few Programs With Output
h>
#include<conio.h>
void main()
{
long int i,j,h=40;
clrscr();
for(i=1;i<11111;i=(i*10)+1,j=j-1)
{
for(j=1;j<h;j++)
{
cout<<" ";
}
cout<<i*i<<"\n";
h--;
}
getch();
}
#include <iostream.h>
#include <fstream.h>
#include <conio.h>
}
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
#include<fstream.h>
void main()
{
clrscr();
char s[100],fname[20];
ifstream ifile;
cout<<"Enter name to read and display its content :";
cin>>fname;
ifile.open(fname);
if(!ifile)
{
cout<<"Error in opening file...";
getch();
exit(0);
}
cout<<"Data in file=";
while(ifile.eof()==0)
{
ifile>>s;
cout<<s<<"";
}
cout<<"\n";
ifile.close();
getch();
}