add MP1, lab2
This commit is contained in:
39
Assignments/lab2_CalebFontenot/main.cpp
Normal file
39
Assignments/lab2_CalebFontenot/main.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/cppFiles/main.cc to edit this template
|
||||
*/
|
||||
|
||||
/*
|
||||
* File: main.cpp
|
||||
* Author: caleb
|
||||
*
|
||||
* Created on February 26, 2024, 10:03 AM
|
||||
*/
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
|
||||
using namespace std;
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
int main(int argc, char** argv) {
|
||||
double d = 8.21;
|
||||
int x, y;
|
||||
x = (int) d;
|
||||
y = static_cast<int> (d);
|
||||
cout << x << " " << y;
|
||||
cout << endl;
|
||||
int num1= 2987, num2 = 5, num3= 122;
|
||||
cout << setw(25) << num1 << setw(3) << num2 << setw(25) << endl;
|
||||
|
||||
string name;
|
||||
cout << "please enter your first and last name:";
|
||||
getline(cin, name);
|
||||
cout << "\n" << name;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user