Showing posts with label ARea of CIRCLE. Show all posts
Showing posts with label ARea of CIRCLE. Show all posts

Monday, 29 October 2012

Program Of GET PUT Function In C

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
 
main()
 
{
 
clrscr();
 
int i,a,m,n;
 
printf("Enter No. Of Char");
 
scanf("%d",&m);
 
printf("\n Contens Of Main File=");
 
for(i=1;i<=m;i++)
 
{
 
scanf("%d",&n);
 
if(n==-1)
 
break;
 
}
 
fclose(f1);
 
f1=fopen("Main","r");
 
f2=fopen("ODD","w");
 
f3=fopen("EVEN","w");
 
while(a!=EOF)
 
{
 
if(a%2==0)
 
{
 
}
 
else
 
{
putw(a,f2);
 
}
 
a=getw(f1);
 

fclose(f1);
 
fclose(f2);
 
fclose(f3);
 
f2=fopen("ODD","r");
 
f3=fopen("EVEN","r");
 
printf("Content of ODD File \n");
 

{
 
printf("%d\n",a);
 
}
 
printf("Content Of Even File\n ");
 
while(a=getw(f3)!=EOF)
 
{
 
printf("%d\n",a);
 
}
 
fclose(f2);
 
fclose(f3);
 
getch();
 
}

Sunday, 6 May 2012

Program Of Opening a File In C++

#include<iostream.h>
#include<conio.h>
main()

{

    clrscr();

    char FirstName[30], LastName[30];

    int Age;

    char FileName[20];

    cout << "Enter First Name: ";

    cin >> FirstName;

    cout << "Enter Last Name:  ";

    cin >> LastName;

    cout << "Enter Age ";

    cin >> Age;

    cout << "\nEnter the name of the file you want to create: ";

    cin >> FileName;


     Students << FirstName << "\n" << LastName << "\n" << Age;
  
    getch();

}

Saturday, 14 January 2012

Program To Find Area Of Circle In C++

     #include<iostream.h>
#include<conio.h>
main()
{
clrscr();
float r,area;
cout<<"Enter Redius=";
cin>>r;
cout<<area;
getch();
}

Wednesday, 11 January 2012

Program To Find Area of Circle Using Static Member Function In C++

#include<iostream.h>
#include<conio.h>

class test
{
                                    private:           //static Data Member   
static int a;
                              static float pi;       // Static Data Member
public:
                          void static display()        // Static Member 
Function
{
cout<<"\n Main Class Value is="<<pi*a*a;
}
} ;
float test :: pi = 3.14;   // Static Data Member Initialization
int test :: a = 5;   //Static Data Member Initialization

main()
{
clrscr();
test t1;
t1.display();
getch();
}