1#include <math.h> /* log */
2
3 double param, result;
4 param = 10;
5 result = log (param);
6 printf ("log(%f) = %f\n", param, result );
1// a simple login for c++ using while loops and io (input output)
2#include <iostream>
3#include <string>
4
5using namespace std;
6
7int main() {
8 cout << "please enter password";
9 string pass = "0"; // making a string for user input
10 cin >> pass; // could be replaced with getline(cin, pass);
11 while (pass = "1234") { // while loop for when password is wrong
12 cout << "incorrect, try again";
13 cin >> pass; // could be replaced with getline(cin, pass);
14 }
15 cout << "correct password"; // runs when the while loop is no longer happening
16}