0
C language
Why doesn’t have any output?! What’s it’s problem?! https://code.sololearn.com/ce5FrO0E3P5t/?ref=app
9 Antworten
+ 3
There are problems in your code:
1. The condition of for loop will never be true. Loops only run when the condition is true.
2. The output is in for loop. It means that if you solve problem 1, the output will be repeated.
3. The while loop of the function of will loop infinitely.
That's what I found. But I can't solve it completely since I don't know the desired output.
0
CarrieForle i try to solve that problems but now it has an an other problem
would you check it please?!
https://code.sololearn.com/ce5FrO0E3P5t/?ref=app
0
May I know what the desired output is? It looks good to me.
0
CarrieForle i want to write a program which takes the user tow number the first number have to be float but the second number hvae to be integer (posetive or negative)
then the program calculate number one to the power of number two,and let us know the answer
(whith out using math.h)
0
If you mean x^y is the desired output.
z = x; //Variable stores value x.
x*=z; //multiply it y times.
x*=x is wrong since x changes after a loop. Like
2*=2; Then the next one it become
4*=4; //The desired is 4*=2 but it's not
0
CarrieForle are you sure it runs?!
i tried it doesn’t run
what i have to do😭😭😭
0
declared it outside of while loop
like
{
float z = x;
while(y!=1) {
z*=x;
.
.
.
}
return (z);
}
0
yeeeees it works💃🏻💃🏻💃🏻
thanks alooooot😎
0
I'm glad you said that. ;)