Latest news: --- Download Final/Mid Term Papers helping Material More Easily without wasting your time --- Learn C++ First Lesson Part Two in Urdu By Virtual Community --- Learn C++ First Lesson Part One in Urdu By Virtual Community --- How to Run and write First Program in Dev C++ ---

Learning Oppertunity

Institution session to learn Programming (asp.net,c# / php )
Online (Practice and Theory)
Who are interested to join this session, email us on ceo.vugujranwala@gmail.com
Please note !!It is paid session, For fee information email us.
Session will held by M Atif Ali

Lost Password?   -   Register


Post Reply 
 
Thread Rating:
  • 15 Votes - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS 201- Compile Programs of Lecture No.10 By Virtual Community
Author Message
10-21-2012, 11:06 AM
Post: #1
Isha saman [ Member From :N/A]
Unregistered
Thumbs Up CS 201- Compile Programs of Lecture No.10 By Virtual Community
Code:
/*Example of Global scop*/
#include<iostream.h>
int i; //Global variable declearation
void f(void);
  main()
{
     i=10;
     cout<<"\n"<<"In main(),the value of i is:"<<i<<endl;
     f();
     cout<<"\n"<<"Back in main(), the value of i is:"<<i<<endl;
     system("pause");
     }
    
     void f(void)
     {
          cout<<"\n"<<"In f(),the value of i is:"<<i;
          i=20;
          }
//Regards: Team Virtual Community COO ......Isha Saman....//
[Image: 20121021100012_10.1.bmp]
Code:
#include<iostream.h>
void f(int);
main()
{
      int i;
      i=10;
      cout<<"\n"<<"In main(), the value is:"<<i<<endl;
      f(i);
      cout<<"\n"<<"Back in main(), the value of i is:"<<i<<endl;
      system("pause");
      }
      void f(int i)
      {
           i*=2;
           cout<<"\n"<<"In f(), the value of i is:"<<i<<endl;
           }
//Regards: Team Virtual Community COO ...... Isha Saman....//
[Image: 20121021100100_10.2.bmp]
Code:
#include<iostream.h>
double square(double);
main()
{
      double i;
      i=123.456;
      
      cout<<"\n"<<"The square of"<<i<<"is:"<<square(i)<<endl;
      cout<<"\n"<<"The current value of i is:"<<i<<endl;
      system("pause");
      }
      
      double square(double x)
      {
             return x*x;
             }
           //Regards: Team Virtual Community COO ...... ISHA SAMAN....//
[Image: 20121021100333_10.3.bmp]
Code:
#include(iostream.h>
void square(double);
main()
{
     double x;
     x=123.456;
    
     cout<<"\n"<<"In main(), before calling square(), x is="<<x<<endl;
     square(&x);
     cout<<"\n"<<"In main(), after calling the square(), x is="<<x<<endl;
    
     system("pause");
     }
    
     void square(double* x)
     {
          *x = *x * *x;
          }
Quote
Our Sponsors


Post Reply 


Messages In This Thread
CS 201- Compile Programs of Lecture No.10 By Virtual Community - Isha saman - 10-21-2012 11:06 AM

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Thumbs Up CS 201- Compile Programs of Lecture No.9 By Virtual Community Isha saman 1 1,418 07-30-2012 03:47 PM
Last Post: **Aamira Queen**
Thumbs Up CS 201- Compile Programs of Lecture No.8 By Virtual Community Isha saman 1 1,575 04-04-2012 10:10 AM
Last Post: ~Abdul~
Thumbs Up CS 201- Compile Programs of Lecture No.7 By Virtual Community Isha saman 0 1,099 04-03-2012 07:40 AM
Last Post: Isha saman
Thumbs Up CS 201- Compile Programs of Lecture No.6 By Virtual Community Isha saman 2 1,474 04-01-2012 11:28 PM
Last Post: CokeAndLays
Thumbs Up CS 201- Compile Programs of Lecture No.5 By Virtual Community Isha saman 0 1,038 03-29-2012 10:48 AM
Last Post: Isha saman
Thumbs Up CS 201- Compile Programs of Lecture No.4 By Virtual Community Isha saman 0 1,103 03-29-2012 08:24 AM
Last Post: Isha saman
Thumbs Up CS 201- Compile Programs of Lecture No.3 By Virtual Community Isha saman 0 1,115 03-28-2012 03:50 PM
Last Post: Isha saman

Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Find US

Terms of Use | Our Team

VuGujranwala.com | Virtual Community (c) All rights reserved 2008-2013
Powered By: Eventual Solutions