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 |
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 ?
#include"stdio.h" #include"conio.h" void main() { int a; printf("\n enter a number:"); scanf("%c\n"); getch(); }
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
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.
#include<stdio.h> void main() { int i=1; printf("%d%d%d",i++,++i,i); }
what are the techniques for reducing the fragility of a memory bug?
who was the present cheif governor of reserve bank of india
6 Answers State Bank Of India SBI,
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.....
how tally is useful?
To generate the series 1+3+5+7+... using C program
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,
Find the error (2.5*2=5) (a) X=y=z=0.5,2.0-5.75 (b) s=15;