Experiment Number - 2
Experiment Number - 2
Experiment Number - 2
2.3) WAP to illustrate the use of scope resolution operator. Display the various values of the
same variables declared at different scope levels.
}
int main()
{
employee e[2];
for(int i=0;i<2;i++)
{
e[i].getdata();
e[i].putdata();
}
}
2.3)
#include<iostream>
using namespace std;
int my_variable = 24;
int main()
{
int my_variable = 125;
cout << "Value of global my_variable is " << ::my_variable<<endl;
cout << "Value of local my_variable is " << my_variable<<endl;
return 0;
}
OUTPUT –
2.1)
2.2)
2.3)
. Approach the programming tasks using techniques learnt and write pseudo-code.
. Choose the right data representation formats based on the requirements of the
problem.
. Use the comparisons and limitations of the various programming constructs and choose the
right one for the task.
1. Worksheet Completion 10
2. Viva 8
3. Conduct 12
Total Marks 30