|
||||||||||
|
|
#1 (permalink) |
|
Googler
![]() Join Date: Dec 2008
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
Computer Programming
#include<iostream.h>
#include<math.h> int main() { //2 int num, num1; cout<<"Enter two variables"<<endl; cout<<"1. "; cin>>num; cout<<"2. "; cin>>num1; if (num1%num==0) {cout<<"True"<<endl; } else {cout<<"False"<<endl; } cout<<endl; cout<<"____________________________________"<<endl ; //5 int a, b, c, answer, answer2; cout<<"Enter variables"<<endl; cout<<"a="; cin>>a; cout<<"b="; cin>>b; cout<<"c="; cin>>c; answer=(-b+(sqrt((b*b)-4*a*c)))/(2*a); answer2=(-b-(sqrt((b*b)-4*a*c)))/(2*a); cout<<"The answer is "<<answer<<" & "<<answer2<<endl; cout<<endl; cout<<"_________________________________________"< <endl; //19 char enter; cout<<"Enter a letter"<<endl; cin>>enter; cout<<endl; switch(enter) { case 'A': cout<<"D"<<endl; break; case 'B': cout<<"E"<<endl; break; case 'C': cout<<"F"<<endl; break; case 'D': cout<<"G"<<endl; break; case 'E': cout<<"H"<<endl; break; case 'F': cout<<"I"<<endl; break; case 'G': cout<<"J"<<endl; break; case 'H': cout<<"K"<<endl; break; case 'I': cout<<"L"<<endl; break; case 'J': cout<<"M"<<endl; break; case 'K': cout<<"N"<<endl; break; case 'L': cout<<"O"<<endl; break; case 'M': cout<<"P"<<endl; break; case 'N': cout<<"Q"<<endl; break; case 'O': cout<<"R"<<endl; break; case 'P': cout<<"S"<<endl; break; case 'Q': cout<<"T"<<endl; break; case 'R': cout<<"U"<<endl; break; case 'S': cout<<"V"<<endl; break; case 'T': cout<<"W"<<endl; break; case 'U': cout<<"X"<<endl; break; case 'V': cout<<"Y"<<endl; break; case 'W': cout<<"Z"<<endl; break; case 'X': cout<<"A"<<endl; break; case 'Y': cout<<"B"<<endl; break; case 'Z': cout<<"C"<<endl; break; default: cout<<enter<<endl; } if (enter==0) {cout<<"Illegalselection--no result calculated"<<endl; } else { cout.setf(ios::fixed); cout<<endl; } return(0); } |
|
|
|
|
Sponsored Links
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Computer Programming | wolfyy1 | Chit Chat | 1 | 01-15-2009 12:24 PM |
| Computer Programming- Guess Game | wolfyy1 | Chit Chat | 2 | 12-16-2008 07:40 AM |
| HELP! with Java Programming | tenzuu | Web Design, Coding & Programming Forum | 0 | 10-19-2007 08:29 PM |
| Web programming question. | Endante | Web Design, Coding & Programming Forum | 6 | 03-23-2006 12:26 PM |
| Game Programming | JoeSSJ4 | General Discussion | 8 | 04-30-2005 11:07 AM |