program to print the numbers from 1 to 10 and their squares.



#include

int main()
{
int i;


for(i = 1; i <= 10; i = i + 1)
{
printf("%d %d\n", i, i * i);
}
return 0;
}

8 comments:

  1. how to make a NUMBER TRIANGLE FROM 1 TO 10
    1
    2 3
    4 5 6
    7 8 9 10

    ReplyDelete
  2. How can i form
    1
    2 3
    4 5 4
    7 8 9 10

    ReplyDelete
  3. how can i form
    ***1***
    **2*3**
    *4*5*6*
    7*8*9*10

    ReplyDelete
  4. how can i print

    1 to 100 in 10 subsequent pages

    ReplyDelete
  5. #include
    #include

    void main()
    {

    int i,a,j,k=1;

    for(i=1;i<=4;i++)
    {
    for (a=1;a<=(-1*(i-5));a++)
    printf(" ");

    for (j=1;j<=i;j++)
    {
    printf("%d ",k);
    k++;
    }
    printf("\n");
    }

    getch();
    }

    ReplyDelete
  6. Flow chart for the square and cube of 1 to 10 numbers

    ReplyDelete
  7. Write a program that prompts the user to enter a number n, then prints all the even
    squares between 1 and n.

    ReplyDelete