


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Function help understanding functions
Typology: Exams
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Important Insructions:
Lab Manual 03
prototypes of overloaded function are:
to the function.
program using integers, characters and real values as arguments.
int x = 5; int &a = x; a = a + 100;
void square(int &a) { cout<<"a:\t"<<a<<endl; cout<<"&a\t"<<&a<<endl; } void main() { clrscr(); int x=5; cout<<"x\t"<<x<<endl; cout<<"&x\t"<<&x<<endl;
square(x); getch(); }
#include <iostream.h>
int a = 10;
int main() { int a = 15;
cout << "main() " << endl; cout << "a = " << a << endl; cout << "::a = " << ::a << endl;
int a = 25; cout << "------------Inner Block------------" << endl; cout << "a = " << a << endl; cout << "::a = " << ::a << endl; }
cout << "-----------Back to main()-----------" << endl; cout << "a = " << a << endl; cout << "::a = " << ::a << endl; }
void time(int h=12, int m=56, int s=35); void main () { int a, b; clrscr(); time(); time(11); time(10,33); time(10,45,58); } void time(int h, int m, int s) { Cout<<h<<”:”<<m<<”:”<<s<<endl; }
using function.