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++;
    }
}

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|