Functions in C++  || Syntax || Functions
In this, we are going to see Functions, the program is based on function which Calculates, Profit or Loss.

The code given below can be used for TURBO C++ Compiler:-

#include<iostream.h>
#include<conio.h>

//declaring and Defining the function or method
//here instead of function_name you can give any name to the function
void function_name()
{
    cout<<"\nHello World!!!\n";
    cout<<"\nWelcome to Help For Coders";
}

void main()
{
    clrscr();
    
    //calling the function in the main function 
    function_name();
    getch();
}

	
    
The code given below can be used for g++/gcc Compiler:-

#include<iostream>
using namespace std;

//declaring and Defining the function or method
//here instead of function_name you can give any name to the function
void function_name()
{
    cout<<"\nHello World!!!\n";
    cout<<"\nWelcome to Help For Coders";
}

int main()
{
    //calling the function in the main function 
    function_name();
    return 0;
}
	
    
#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post