Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream> //cout and cin
- #include <math.h> //sqrt
- using namespace std;
- int main()
- {
- int x = -100;
- while (x <= 100) {
- if (x < 0)
- {
- cout << sqrt(x * x + 1) << endl;
- }
- else {
- if (x == 20) {
- cout << "Cannot divide by 0" << endl;
- }
- else
- {
- cout << (x + 10) / (x - 20) << endl;
- }
- }
- x = x + 10;
- }
- system("pause"); // if you press f5 and not control f5,
- }
Advertisement
Add Comment
Please, Sign In to add comment