24 August 2018

C Program to print square(s) from 1 to n

//Program to print square(s) from 1 to n
#include<stdio.h>

int main()
{
    int n,i,square;
    printf("\n Enter up to which number you want to find square(s):");
    scanf("%d",&n);
    printf("\n Square value(s):");
    for(i=1;i<=n;i++)
        {
        square=i*i;
        printf("\n\t %d ^ 2 = %d",i,square);
        }
    printf("\n");
return 0;
}

No comments:

Post a Comment

To convert from Upper case to lowercase(A to a)

//converting from Upper to lower(A to a) import java.util.*; class case { public static void main(String args[]) { System.out.pr...