From cb92a8e5a154228b2f561f50bd7c84e8e07805cc Mon Sep 17 00:00:00 2001 From: Kiril Klein <kiril.klein@fau.de> Date: Mon, 28 Oct 2019 13:28:59 +0100 Subject: [PATCH] Upload New File --- inputs/task_1.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 inputs/task_1.cpp diff --git a/inputs/task_1.cpp b/inputs/task_1.cpp new file mode 100644 index 0000000..89fc323 --- /dev/null +++ b/inputs/task_1.cpp @@ -0,0 +1,15 @@ +#include <iostream> + +/* + For this task, read in a number n on cin and print out the first n square numbers each in their own line +*/ +int main(int argc, char **argv) { + int n; + std::cout<< "Enter a number:"<<std::endl; + std::cin>>n; + std::cout<<std::endl; + for(int i=0; i<=n; i++){ + std::cout<<i*i<<"\n"; + } + return 0; +} -- GitLab