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 |
what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }
loop1: { x=i<n?(i++):0; printf("%d",i); exit(x); continue; } Error- misplaced continue. Doubt-1.will the exit(x) be executed for all values of x 2.will this statement go out of the program.
how tally is useful?
what is exceptions?
how to convert decimal to binary in c using while loop without using array
50 Answers Apple, Aptech, Arwen Tech, BCS, C2D Software, CEC,
class test { int a; public: test(int b):a(b){} void show(){ cout<<a; } }; void main() { test t1; test t2(5); t1.show(); t2.show(); } }
what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?
To generate the series 1+3+5+7+... using C program
what is run time error?
What are the different types of errors in C and when they occur?
Write a program to accept two strings of Odd lengths. Then take all odd characters from one string and even characters from the other and concatenate and produce a string.
A sample program using data structure? what is file handling?