the program is not runing in C

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.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…