chap4 - 1#include #include void main...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1. #include <iostream.h> #include <conio.h> void main() { clrscr(); char letter; cout<<"Enter a character : "; cin>>letter; //determine letter is lowercase or not cout<< "Entered character is a lowercase letter \n"; else cout<< "Entered character is not a lowercase letter \n"; getch(); } 2. #include <iostream.h> #include <conio.h> void main() { clrscr(); char status; int senior=400, junior=275; cout<< " Enter status(j for junior and s for senior): "; cin>>status; if (status== 'S' || status== 's') cout<< "Senior person salary is Rs."<<senior; else if (status== 'J' || status== 'j') cout<< "Junior person salay is Rs."<<junior; else cout<< "You should select senior or junior, try again!"; getch(); } 3. #include <iostream.h> #include<conio.h> void main() { int a,b,c; clrscr(); cout<<"Enter the value of a , b and c:"; cin>>a>>b>>c; if(a==0) { cout<<"divisor can not be 0"<<endl;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
} else { cout<<a<<" is a common divisor of "<<b<<" and "<<c<<endl; else cout<<a<<" is not a common divisor of "<<b<<" and "<<c<<endl; } getch(); } 4. #include <iostream.h> #include <conio.h> void main() { char op; int side, base, height; float area; clrscr(); cout<<"Enter choice (S for Square, T for Triangle:)"; cin>>op; if(op == 'S') { cout<<"Enter side: "; cin>>side; area = side * side; cout<<"Area ="<< area; } else if(op == 'T') { cout<<"Enter base:"; cin>>base; cout<<"Enter height:"; cin>>height;
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/07/2012 for the course COMPUTER S 111 taught by Professor Kash during the Spring '11 term at Globe.

Page1 / 8

chap4 - 1#include #include void main...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online