Notice: Undefined offset: 141802 in /var/www/html/qa-external/qa-external-users.php on line 744

Notice: Undefined offset: 139391 in /var/www/html/qa-external/qa-external-users.php on line 744

Notice: Undefined offset: 2490297 in /var/www/html/qa-external/qa-external-users.php on line 744

Notice: Undefined offset: 13707189 in /var/www/html/qa-external/qa-external-users.php on line 744
The following C program i have taken from book but output is not coming- Solution required- kindly help. - OnlineGDB Q&A
Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

closed The following C program i have taken from book but output is not coming- Solution required- kindly help.

–5 votes
asked Apr 3, 2018 by Power Murugan (190 points)
closed Sep 26, 2021 by Admin
int mul (int a, int b);
main()
{
    int a, b, c;
    a = 5;
    b = 10;
    c = mul (a,b);
    printf ("multipilcation of %d and %d is %d",a,b,c);
}
    int mul (int x, int y)
    int p;
    {
        p = x*y;
        return(p);
    }
closed with the note: answered

31 Answers

0 votes
answered Jun 28, 2021 by Ramesh Matlapudi (140 points)
#include <stdio.h>

int add (int,int);
int main()
{
    int ans = add(6,9);
    
    printf("ans is %d \n",ans);
    
    return 0;
}
    int add(int i, int j)
    {
        int k = i*j;
        return k;
    }
commented Jun 29, 2021 by Peter Minarik (101,340 points)
Why would you call a function "add" when what it does is multiply?

This is confusing and makes it way harder to understand what the code does.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...