90 likes | 175 Views
welcome. computer science. Presented By:. Vikas & Manoj Submitted to : Sanwari Sharma PGT Computer Science. How to find that a character is an Alphabet or not. PROGRAM NO. 1. #include<conio.h#include<iostream.h> > void main() { clrscr(); char ch; cout<<"enter any character"<<endl;.
E N D
welcome computer science
Presented By: • Vikas & Manoj Submitted to : Sanwari Sharma PGT Computer Science
How to find that a character is an Alphabet or not PROGRAM NO. 1
#include<conio.h#include<iostream.h> > void main() { clrscr(); char ch; cout<<"enter any character"<<endl;
cin>>ch; if(ch>='a'&&ch<='z'||ch>='A'&&ch<='Z') { cout<<ch<<" "<<"is an alphabet"; cout<<endl; } else cout<<ch<<" "<<"is not an alphabet"; getch(); }
How to find no. of years ,month , Weeks , and days from given no. of days PROGRAM NO. 2
#include<iostream.h> #include<conio.h> void main() { clrscr(); int days,year,month,week,x,y; cout<<"enter no. of days"; cin>>days; cout<<endl;
year=days/365; month=days%365/30; x=days%365%30; week=x/7; y=x%7; cout<<days<<"days contain"<<year<<"years"<<month<<"months"<<week<<"weeks"<<y<<"days"; getch(); }