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

Given that two int variables, total and amount , have been declared, write a sequence of statements that: initializes total to 0 reads three values into amount , one at a time. After each value is read in to amount , it is added to the value in total (that is, total is incremented by the value in amount ). Instructor's notes: If you use a loop, it must be a for loop. And if you use a loop control variable for counting, you must declare it.

1 Answers   Google,


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

2 Answers  


what is exceptions?

5 Answers   HCL, Wipro,


printy(a=3,a=2)

3 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  






What is probability to guarantee that the task a programmer is going to create will be created and be able to run on a particular system (RTOS/GPOS).

0 Answers  


Using string functions write a program that will accept the name of the capital as input value and will display the corresponding country. ------------------------ Capitals Countries ------------------------ Capitals Countries Ottawa Canada Moscow Russia Rome Italy I can't not get it to run properly

1 Answers   AMA,


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  


What is the out put of this programme? int a,b,c,d; printf("Enter Number!\n"); scanf("%d",&a); while(a=!0) { printf("Enter numbers/n"); scanf("%d%d%d",&b,&c,&d); a=a*b*c*d; } printf("thanks!"); getche(); Entering numbers are a=1,b=2,c=3,d=4 b=3,c=4,d=-5 b=3,c=4,d=0

5 Answers   TCS,


what is the large sustained error signal that eventually cause the controller output to drive to its limit

1 Answers   TCS,


what is run time error?

7 Answers  


void main() { int i=5,y=3,z=2,ans; clrscr(); printf("%d",++i + --z + i++ + --i * ++y); i=5,y=3,z=2; ans=++i + --z + i++ + --i * ++y; printf("\n%d",ans); getch(); } Its output is 37 and 31.... Please explain me why its different How it works.....

2 Answers  


Categories