BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan

BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan (http://bzupages.com/)
-   Object Oriented Programming (http://bzupages.com/35-object-oriented-programming/)
-   -   Use of Function in C++ 1st lecture by Mam... (http://bzupages.com/f35/use-function-c-1st-lecture-mam-687/)

.BZU. 05-09-2008 02:53 AM

Use of Function in C++ 1st lecture by Mam...
 
Madam nay Yeh wali file Compile ki thei..
We can understand the main concept of Functions in C++ Language by using this simple program developed by the mam Sidra in the class room


Code:

#include
#include
using namespace std;
void function1()
{
        cout<<"this is function1"<

}
void function2(int var1,float var2,char var3)
{
        cout<<"this is function2"<
}
int function3()
{

        cout<<"this is function3"<                 return 100;

}
float function4()
{

        cout<<"this is function4"< }
float function5(float var4)
{

        cout<<"this is function5"<         return 100.5;
}

struct dis
{
        int f;
        int inc;

};





void function6(dis d)
{

        cout<<"this is function6"<        
}
int main()
{
        int var;float var2;


        dis d1={22,22};

        function1();
        function2(25,25.0,'b');
        var=function3();
        cout<<"this value is returned by function3 "<         var2=function4();
                cout<<"this value is returned by function4 "<         var2=function5(100.5);
                cout<<"this value is returned by function5"<

                function6(d1);
        return 0;
}


:book1:


All times are GMT +5. The time now is 07:01 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.