473,387 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

printing derivative

gud am...i am currently working with a project of mine which is about derivative...and i am having some problem with the printing of the derivative...
here is the block of code i used:

/* print derivative of each term */

x=30;
gotoxy(x, 15);
if(exponent!=0){
if(coefficient*exponent>=1){
printf("%d",coefficient*exponent);
x++;
}

if(exponent-1>=1){
printf("%c",variable);
x++;
if(exponent-1!=1){
printf("%d",exponent-1);
x++;
}
}
else if(exponent-1==0){
printf("%c",operator[ctr]);
x++;
}
}

else{
printf("0 %c ",operator[ctr]);
x++;
}
}



could someone help me why it always prints on the location coordinates (30, 15)? i would gladly and humbly accept any comments or suggetstions that would help me in this work...gud day...
Mar 20 '08 #1
3 1505
Laharl
849 Expert 512MB
It always prints at (30,15) because you use gotoxy(x,15) after you set x to 30. If you want it to print someplace else, change that initialization.
Mar 20 '08 #2
It always prints at (30,15) because you use gotoxy(x,15) after you set x to 30. If you want it to print someplace else, change that initialization.

uhm...i want to start printing the derivative at that cooridanate...however, the cursor is not moving even if i try to change the value of x by incrementing...
can u pls tell me why it happened so?
Mar 20 '08 #3
Laharl
849 Expert 512MB
You don't call gotoxy() again, so it doesn't know to move. Just because you passed x to gotoxy() doesn't mean every change in x will bring about another call to the function to reflect the update.
Mar 20 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Jody Gelowitz | last post by:
I am trying to find the definition of "Safe Printing" and cannot find out exactly what this entitles. The reason is that I am trying to print contents from a single textbox to no avail using the...
3
by: xhunga | last post by:
Hello, This time I try to simulate the derivative of a product. Into a text file, I have an equation of this type. I have created these equations with the previous functions. Examples:
0
by: xhunga | last post by:
Symbolic computation : the derivative of a quotient. Hello, This time I try to simulate the derivative of a quotient. The same function use the quotient rule if it is a quotient (f/g) and the...
0
by: xhunga | last post by:
* Symbolic computation with the language c : The Derivative step by step. (Windows,Linux) You can find some examples into the file a_exampl.txt @ @
2
by: chitrapandy | last post by:
how to write a c program for this question. what is the concept behind this question. Assuming that a function f() and its derivative fprime() are provided, design a function to compute the roots...
11
by: shanazzle | last post by:
so I've just begun learning python for a school course. I have to write a simple program that finds the first derivative of the equation Y= Ax^4 + Bx^3 + Cx^2 + Dx + E so far i can have the user...
10
by: DDCane | last post by:
i have made a code for finding a derivative and now im trying to use it to help me with a code for the newton raphson method: def derivative (f,x,h): import math return float(1/(2*h)) *...
6
by: knielsen73 | last post by:
Hi, I am looking to do a simple derivative. I would expect such a function to be available in numpy, but can't find it. I have written my own, but just curious if anybody knows of such function...
1
by: madman228 | last post by:
Hi guys I have run in to a littl bit of trouble. I am writing a class called polynomial in which i need a derivative method I have everything, just dont know how to start the derivative method. Any...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.