answersLogoWhite

0


Best Answer

#include

using std::cout;
using std::endl;

int main(viod)
{
cout << endl << "This program prints numbers from 1 to 500."
for (int i = 1; i <= 500; i++)
{
cout << endl << i << ;

}

cout << endl;
system("PAUSE");
return 0;

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to Write a c plus plus program to print number from 1 to 500?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

C plus plus program to print number patterns?

bghjg


Write a program in BASIC to find the sum of the series s equals 2 plus 4 plus . plus 100?

10 print "That is not a question." 20 print "That is a command." 30 end


A program c plus plus on automorphic numbers or not?

how to write a program that counts automorphic number from 1 to 999


How to write a program in c plus plus to print table of even number?

void print_evens (size_t n) {for (size_t x=0; x&lt;=n; x+=2) { std::cout &lt;&lt; x &lt;&lt; std::endl; } }


Write a C plus plus function that print a triangle of stars?

Write a function that print a triangle of stars.


Do I need a C plus plus program to print PASCAL's triangle?

No.


What is the importance of functions in a c plus plus program?

Functions are very important in C++, as you can't write the simplest program to print hello without using a function. Overall you can say that function are building blocks of a C++ program. Functions can also be defined by the programmer to reduce program size.


Write a program to print odd numbers In C plus plus between 51 to 100?

#include &lt;iostream&gt; int main() { for(int i=51; i &lt;= 100; i+=2) { cout &lt;&lt; i &lt;&lt; endl; } return 0; }


Write the steps in c plus plus program to print your name and age at different lines?

#include&lt;iostream&gt; int main() { std::cout&lt;&lt;"your name\nyour age"&lt;&lt;std::endl; return(0); }


What are the steps in c plus plus program to print word computer?

std::cout&lt;&lt;"computer"&lt;&lt;std::endl;


How you write a program in c plus plus to print plaindromic numbers from 1 to n?

To check if a number is a palindrome, reverse the number and see if it is equal to the original number. If so, the number is a palindrome, otherwise it is not. To reverse a number, use the following function: int reverse(int num, int base=10) { int reverse=0; while( num ) { reverse*=base; reverse+=num%base; num/=base; } return(reverse); }


How do you write a C plus plus program that will display the first 10 positive prime numbers?

By learning how to program on C+.