Your lines are prepended with >, mine are just normal. I've commented on your code.
>#include<stdio.h> If you are using c++, use #include <cstdio> >main( )should be int main(). c-99 (I think) allowed the return type to be int if none was specified, now developers that use this get shot.
>{ > int a,b,c,d; > int sum,sub,mul,rem; > float div; > printf("ENTER VALUES OF b, c, d"); > scanf("%d%d%d",&b&c,&d);You need a comma between your second and third argument, also I think you need to space out your formatters.
> sum = b+c; > sub = b-c; mul = b*c; > div = b/c; > rem = b%d; > a = b/c * d;I'm not sure what you're trying to do here, just remember your order of operations.
> printf("\n sum = %d, sub = %d, mul = %d, div = %f",sum,sub,mul,div); > printf("\n remainder of division of b & d is %d",rem); > printf("\n a = %d",a);Since you're going to be a good little coder and use int main for ever after, you need a return 0 here, like this:
return 0; } Enjoy! On 4/12/2011 6:58 AM, ashish rohtagi wrote:
hello friends, I thought my message did not reach the list. thanks punit and everyone else for helping. here is my code. I am studying operators and this program is giving errors. please explain and help. thanks for helping again, here is the code. "#include<stdio.h> main( ) { int a,b,c,d; int sum,sub,mul,rem; float div; printf("ENTER VALUES OF b, c, d"); scanf("%d%d%d",&b&c,&d); sum = b+c; sub = b-c; mul = b*c; div = b/c; rem = b%d; a = b/c * d; printf("\n sum = %d, sub = %d, mul = %d, div = %f",sum,sub,mul,div); printf("\n remainder of division of b& d is %d",rem); printf("\n a = %d",a); }" I used it without quotes. take care, regards. ashish On 4/12/11, Punit Diwan<punitdiwan@xxxxxxxxx> wrote:Do mention what u r trying to do in the program Regards Punit On Tue, Apr 12, 2011 at 5:52 PM, Florian-achtige <florianbeijers@xxxxxxxxx>wrote:Aye, I am not an expert but I've been where you are so maybe I can help some, too 2011/4/12, Littlefield, Tyler<tyler@xxxxxxxxxxxxx>:I didn't see this until I seen the post from Punit. You can just post here. send the program with errors. On 4/12/2011 12:00 AM, Punit Diwan wrote:Hi Ashish, Pls send the error along with program. You can send me off the list on my gmail account. I will reply immediately. Regards Punit On Mon, Apr 11, 2011 at 6:04 PM, ashish rohtagi <ashishrohtagi1969@xxxxxxxxx<mailto:ashishrohtagi1969@xxxxxxxxx>>wrote:hello friends, I installed Dev c++ but I have written some verybasicprograms but they are giving compile errors. so should I paste those programs here and get some guideance? take care, regards. ashish. __________ View the list's information and change your settings at //www.freelists.org/list/programmingblind-- Thanks, Ty__________ View the list's information and change your settings at //www.freelists.org/list/programmingblind__________ View the list's information and change your settings at //www.freelists.org/list/programmingblind
-- Thanks, Ty __________View the list's information and change your settings at //www.freelists.org/list/programmingblind