Page 1 of 1

## 1 Replies - 1153 Views - Last Post: 06 March 2008 - 03:00 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=45315&amp;s=825b0b2bc39a7f2c3e02b9f2e646c319&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 pikapika02

Reputation: 0
• Posts: 1
• Joined: 06-March 08

Posted 06 March 2008 - 02:53 AM

#include<stdio.h>
#include<string.h>
char exp[100];
int a, b, x,y=2,ctr;
main(){
clrscr();
printf("Enter expression:\n");
gets(exp);
for(x=0;x!=10;ctr++){
y=y+2;
x=x+2;
a=(int)exp[0]*exp[2];
b=(int)exp[2]-1;
printf("%d %c^%d",a,exp[1], b );

}
this is my code. im supposed to make a program that prints out a derivative of an entered polynomial expression, but when it prints out the answer, the ASCII code is the one being printed. please help me. and if you have some revisions and changes meant for the development of my program, please post. thanks a lot.

Is This A Good Question/Topic? 0

### #2 no2pencil

• Professor Snuggly Pants

Reputation: 6727
• Posts: 31,155
• Joined: 10-May 07

Posted 06 March 2008 - 03:00 AM

Why are you multiplying char values?
```a=(int)exp[0]*exp[2];

```