Computer Science, asked by arghaauddy, 1 year ago

Write a c program to display the square root of the first ten natural numbers.

Answers

Answered by HarishAS
2
#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;
}
==========================================================
#include <stdio.h>
#include <math.h>
#include<conio.h>
void main()
{
int i,n;
clrscr();
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));
}
getch();
}

===================================================
Both the program works properly. 

Hope my answer is helpful to u. Pls mark as brainliest if u like.
Similar questions