Declaration of Cube
Guys please help me.. Is this a right way to declare cube.?
If i Compile it.
It Says: Cube undeclared
what should i do?
Please help
\thanks in advanced
#include<stdio.h>
#include<math.h>
#include<conio.h>
main( )
{
float x,y;
while(x++<10.0)
{
printf("Enter Number:");
scanf("%d", &x);
y = cube(x);
printf("%f %f %f \n", x,pow(x,2),y);
cube(x);
}
{
float x;
float y;
y = x*x*x;
}
getch();
return (y);
}
Answers were Sorted based on User's Feedback
Answer / michael
you need to do
printf("Enter Number:");
scanf("%d", &x);
before entering while loop
becauser in while loop it needs to know what is x
or
float x=0
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sanjay741
its so simple... 1st of all i would like to tell you that Cube(element) is not a math function... so develop a function for cude and just call it...
| Is This Answer Correct ? | 1 Yes | 1 No |
Why are memory errors hard to debug?
what is exceptions?
who was the present cheif governor of reserve bank of india
6 Answers State Bank Of India SBI,
What are the different types of errors in C and when they occur?
write the value of x and y after execution of the statements: int x=19,y; y=x++ + ++x; x++; y++;
WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf("%d%d%d",x,y,z); }
main() { char c; for(c='A';c<='Z';c++) getch(); }
How to create a program that lists countries capitals when country is entered? (Terribly sorry, I'm a complete novist to coding with C, am looking for inspiration and general tips on how to code and create this program.)
what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?
Find the error (2.5*2=5) (a) X=y=z=0.5,2.0-5.75 (b) s=15;
Write down the difference between c. Loop and goto statement d. (!0) and (!1) e. (1= =! 1) and (1!=1) f. NULL and !NULL
Given that two int variables, total and amount, have been declared, write a loop that reads integers into amount and adds all the non-negative values into total. The loop terminates when a value less than 0 is read into amount. Don't forget to initialize total to 0. Instructor's notes: This problem requires either a while or a do-while loop.