Answer to Question #237976 in C++ for Indokerudi

Question #237976

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.


1
Expert's answer
2021-09-16T13:04:19-0400
#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";
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS