Design an algorithm which gets a natural value N as it's input and calculate the numbers equal or less than N. Then write it in a standard output.
#include<iostream>
using namespace std;
int main()
{
int N,x;
cout<<"Enter an interger N: ";
cin>>N;
for(x=0;x<=N;x++)
{
cout<<x<<"\n";
}
}
Comments
Leave a comment