Skip to content
Snippets Groups Projects

Upload New File

1 file
+ 15
0
Compare changes
  • Side-by-side
  • Inline
inputs/task_1.cpp 0 → 100644
+ 15
0
 
#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;
 
}
Loading