#include <stdio.h>
#include <math.h>
int main (void)
{
double x;
double y;
double result;
printf("Enter an integer for x\n");
scanf("%d",&x);
printf("Enter an integer for y\n");
scanf("%d",&y);
result = pow(x,y);
printf("x...
User Profile
Collapse
-
-
it should not be correct..
becoz the output should be:
1
4
9
16
25
36
49
64
81
100
?Leave a comment:
-
[code=c]
#include <stdio.h>
#include <math.h>
int main ()
{
double x = 1;
double y = 1;
double result;
for ( x = 1; x <= 10; x++ ){
printf("%f\n",r esult = pow(x,y) );
}
return 0;
}
[/code]
i did it but the output is seems not correct:
...Leave a comment:
-
-
is it ok?
[code=c]
#include <stdio.h>
int square(int y);
int main (void)
{
int x;
for (x = 0;x>=0;x++) {
printf ("%d",square (x) );
}
printf("\n");
return 0;
}
int square (int y)
{
return y*y;
}[/code]Leave a comment:
-
i jus started to do programming since last month and i still a newbie =(
i cant solve the question ,it's hard for me =(Leave a comment:
-
C++ Program to Calculate X^Y
Question:
Write a Program using Functions that calculates X^Y where both X and Y are doubles and X is positive. (Hints: Call the function pow() in <math.h>)
No activity results to display
Show More
Leave a comment: