Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

the program is not runing in C

Status
Not open for further replies.

sxy

Member
Code:
#include <stdio.h>
int multiplication(int a,int b)
{
int c;
c=a*b;
return c;
}
void main(void)
{
int r;
r = multiplication(2,8);
printf(“%d”,r);
}

I should get 16 but it is not runing.
why?
thanks a lot
 
Well, I've run into a similar problem few days ago (I'm also C beginner).

Answer to my problem was, that scanf() is reading until it reaches something it cannot read (if there's int, then str, etc.), so try put there something, that's not a number (e.g. if you want to use input 24, then write: "24 x")

Hopefully this helps :)

router login

picashow
 
Last edited:
I don't have the strength to deal with it. Downloading software shouldn't be such a complicated thing.
Maybe proramming isnt for you then as stuff like this is what programming is all about.

are you DL the right program, ru x86/64 , got enough ram, correct win ver... ect, maybe try a older ver of studio, i DL 2015 last week cos it was the only free one that works with my Pc.

try your own h scripts, using prebuilt(someone elses) leaves you susceptible to their code and their mistakes.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top