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() { for(int i=0;i<5;i++); printf("%d",i); } What is the output?..

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


what is meant for variable not found?

3 Answers  


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

2 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,


main() { char c; for(c='A';c<='Z';c++) getch(); }

9 Answers  






How to convert hexadecimal to binary using c language..

1 Answers   Bajaj, GAIL, Satyam, Zenqa,


difference between c/c++ programing language? what is necessesity of c++ when existing c programing language?

2 Answers   TCS,


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

24 Answers   HCL,


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,


#include"stdio.h" #include"conio.h" void main() { int a; printf("\n enter a number:"); scanf("%c\n"); getch(); }

12 Answers   HCL,


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); }

2 Answers  


what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }

4 Answers  


Categories