ProAnswers.org

Write a C program to print five numbers starting from one together with their squares.?

#include<stdio.h>

#include<conio.h>

void main()

{

int i;

clrscr();

for(i=1;i<=5;i++)

printf(“\n number: %5d its square : %8d”, i, i*i);

getch();

}

Output:

Number: 1 it‟s square: 1

Number: 2 it‟s square: 4

Number: 3 it‟s square: 9

Number: 4 it‟s square: 16

Number: 5 it‟s square: 25