Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#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 explained in post #5, you had : “%d” it should be "%d" - wrong punctuation marks.So what was the problem in my code?
Bad mistake typing it in, I cut and pastedOMG I typed it all in... Where did those inverted commas come from..
#include <stdio.h>
#include <stdlib.h>
int main() {
//array declaration
int rollNo[10];
char inpt[3];
//taking inputs
for(int i=0;i<10;i++)
{
scanf("%s",inpt);
rollNo = atoi(inpt);
}
//printing
for(int i=0;i<10;i++)
printf("%d ",rollNo);
return 0;
}
for(int i=0;i<10;i++)
{
scanf("%s",inpt);
rollNo = atoi(inpt);
}
for(int i=0;i<10;i++)
{
scanf("%s",inpt);
rollNo[i] = atoi(inpt);
}
Perhaps you should try reading the thread?, that answer has long since been given - more than once!.It should be like this
#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);
}
Please note that your “%d” looks different than mine. The online C compiler found this error when I copy pasted your code.