Write a program using user-defined funtion.

The program uses a user-defined function. A function defined by the user is equivalent to a subroutine in FORTRAN or subprogram in BASIC.

#include <stdio.h>
main()
{
int a,b,c;
a = 5;
b = 10;
c = mul(a,b);
printf(" Multiplication of %d and %d is %d.", a,b,c);
}
mul(x,y)
int p,x,y;
{
p = x*y;
return(p);
}

The program will print the following output:

Multiplication of 5 and 10 is 50.

0 comments:

Post a Comment

 

About Me

It's Me!Hi, I'm Moinuddin. I'm a Software Engineer at WIPRO working on Microsoft .NET Technology. I'm interested in a wide range of technology topics, mainly Microsoft including Windows Azure, WCF, WPF, Silverlight and any other cool technology that catches the eye.

Site Info

ProjectCSharp.com is mainly about demonstrating real time examples in different technologies like ASP.NET, WCF, WPF, Silverlight, Azure etc..,

Followers

Help Links

Project CSharp (C#) Copyright © 2011. All Rights Reserved.