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



Declaration of Cube Guys please help me.. Is this a right way to declare cube.? If i Compile it. ..

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

Declaration of Cube Guys please help me.. Is this a right way to declare cube.? If i Compile it. ..

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

Post New Answer

More C C++ Errors Interview Questions

void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?

24 Answers   HCL,


full c programming error question based problem

3 Answers   HCL, TCS,


void main() { for(int i=0;i<5;i++); printf("%d",i); } What is the output?..

32 Answers   College School Exams Tests, CTS, HCL, iGate, SmartData,


Display this kind of output on screen. 1 0 1 1 0 1 3. Display this kind of output on screen. 1 1 0 1 0 1 4. Display this kind of output on screen. 1 1 0 1 0 1 5.Display this kind of output on screen. 1 2 3 4 5 6 7 8 9 10

1 Answers  


#include<>stdio.h> #include<>conio.h> { printf("hello"); void main() getch(); } what the out put of this program and why ......plz clear my answer

10 Answers   Wipro,






A sample program using data structure? what is file handling?

0 Answers   TCS,


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.)

0 Answers  


What are the different types of errors in C and when they occur?

4 Answers  


I can not get my C++ program to work right. It is supposed to tell if a word is a palindrome or not, but it only tells thet the word is not a palindrome. And I can't fix it.

1 Answers  


How to upgrade LOOP environment, I just mean, how can i make loop statement editable ? I just try some program using loop statement and checking it in multiple compilers. Every compiler showing different output, what's the wrong ? is it a compiler based problem, or loop based problem, tell me why ? and what will be the debugging process, for this kind of problem ?

1 Answers  


Write a C program to enter 10 integer numbers through one variable and count how many of them are even using while loop ?

2 Answers  


Write a c-programe that input one number of four digits and find digits sum?

2 Answers  


Categories