/*
A C++ program to calculate area of circle
Date:
*/
//Single line comment
#include<iostream.h>
#include<conio.h>
void main()
{
float r;
float pi=3.14;
float ac;
clrscr();
cout<<"\n Please enter Radius=";
cin>>r;
ac=pi*r*r;
cout<<"\n Area of circle="<<ac;
getch();
}
/*
A cpp program to understand use of character in the
program
*/
#include<iostream.h>
#include<conio.h>
void main()
{
char x;
clrscr();
cout<<"\n Please Single Character=";
cin>>x;
cout<<"\n Entered Character="<<x;
getch();
}
/*
A cpp program to understand single character with
if statement
*/
#include<iostream.h>
#include<conio.h>
void main()
{
char x;
clrscr();
cout<<"\n Please Single Character=";
cin>>x;
if(x!='Y')
{
cout<<"\n Welcome";
}
cout<<"\n To TY A And B Division Students";
getch();
}
/*
A cpp program to understand use of string
*/
#include<iostream.h>
#include<conio.h>
void main()
{
char x[10];
clrscr();
cout<<"\n Please Enter String=";
cin>>x;
cout<<"\n Entered string="<<x;
getch();
}
No comments:
Post a Comment