Skip to main content

Program_function_02


Adding two Integer number using Function.

/* Adding two Integer number using Function.*/
 #include <stdio.h>
int sum( int x, int y); /* function prototype */
int sub( int x, int y);
int mul( int x, int y);
int div( int x, int y);
 /* function main begins program execution */
 void main( )
 {
    sum (5,7);
    sub (10,5);
    mul (10,5);
    div (10,5);

 } /* end main */
/* Function maximum definition */
/* x, y and z are parameters */
int sum( int x, int y)
{
    printf ("%d", x+y);
    getch();
} /* end function maximum */
int sub( int x, int y)
{
    printf ("%d", x-y);
    getch();
}
int mul( int x, int y)
{
    printf ("%d", x*y);
    getch();
}
int div( int x, int y)
{
    printf ("%d", x/y);
    getch();
}
Output:


Comments

Popular posts from this blog

How to make a Calculator

Calculator  - Visual Basic 2008 / 2010 Part- 1 This tutorial will show you how to make a basic calculator: Click on Project next to Create:  Click on Windows Form Application, and name the project "Your name's Calculator" and then click Ok. You can change the form text to "your name's calculator". Click on the form and then go to properties window, then change the text property. You also need to disable the maximize control of the form. That's because you don't want the user to maximize the calculator. Go to the properties window, and change the maximize box property to False:   You also need to change the FormBorderStyle property to Fixed3D   Add a button to the form and place on top of the form:   You might be surprised of this button because we should have placed a text box instead. Well, this is the cool thing about Visual Basic 2008, you can use a button to display text and results. Now we have to change the button prope

Professional WordPress Design and Development, 3rd Edition

Professional WordPress: Design and Development, 3rd Edition Brad Williams, David Damstra, Hal Stern ISBN: 978-1-118-98724-7 504 pages December 2014 Professional WordPress is the only WordPress book targeted to developers, with advanced content that exploits the full functionality of the most popular CMS in the world. Fully updated to align with WordPress 4.1, this edition has updated examples with all new screenshots, and full exploration of additional tasks made possible by the latest tools and features. You will gain insight into real projects that currently use WordPress as an application framework, as well as the basic usage and functionality of the system from a developer's perspective. The book's key features include detailed information and real-world examples that illustrate the concepts and techniques at work, plus code downloads and examples accessible through the companion website. Written by practicing WordPress developers, the c

SEO (Search Engine Optimization)

What is SEO? SEO is the active practice of optimizing a web site by improving internal and external aspects in order to increase the traffic the site receives from search engines. Firms that practice SEO can vary; some havea highly specialized focus while others take a more broad and general approach. Optimizing a web site for search engines can require looking at so many unique elements that many practitioners of SEO (SEOs) consider themselves to be in the broad field of website optimization (since so many of those elements intertwine). This guide is designed to describe all areas of SEO - from discovery of the terms and phrases that will generate traffic, to making a site search engine friendly to building the links and marketing the unique value of the site/organization's offerings. Why can't the search engines figure out my site without SEO help? Search engines are always working towards improving their technology to crawl the web more deeply and return increa