Q:

C Program to print Square, Cube and Square Root of all numbers from 1 to N

0

C Program to print Square, Cube and Square Root of all numbers from 1 to N

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <stdio.h>
#include <math.h>
 
int main()
{
    int i,n;
 
    printf("Enter the value of N: ");
    scanf("%d",&n);
 
    printf("No     Square   Cube    Square Root\n",n);
    for(i=1;i<=n;i++)
    {
        printf("%d \t %ld \t %ld \t %.2f\n",i,(i*i),(i*i*i),sqrt((double)i));
    }
     
    return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now