Program to display first 10 even numbers and their squares


#include <iostream.h>
void main()
{
    int n ,count=1;
    cout<<"First 10 even numbers and their squares:\n";
    cout<<"\nNumber\tSquare\n";
    for (n=2 ;count<=10; n=n+2)
    {
        cout<<n<<"\t"<<n*n<<endl;
        count++;
    }
}

No comments:

Post a Comment