Installation of Visual Studio
Installation of Visual Studio
Step 1: The first step while we start the installer is to select the language of our choice as shown
in the below screenshot.
Step 2: Once you select the appropriate language, you have to agree to the license agreement
that pop-ups next.
Step 3: Next, we are asked to select the components that we need to install as a part of the dev-
C++ installation.
Step 4: Now the installer prompts the user for the destination folder where the dev-C++
files/libraries etc. are to be copied.
Step 5: The following screenshot shows the progress of the installation.
Once the installation is over, a “finish” dialog that signals the end of the installation appears. We
click finish and then we can launch the dev-C++ IDE.
Installation of Visual Studio
Step 1: Double-click the .exe file, the Visual Studio installer window will open. Click
"Continue".
Step 2: Downloading and installing the progress bar window will open after clicking
the continue button.
Step 3: After completing the download and installation, then workloads will open.
We need to select what are the workloads we need. Here, we selected ASP.NET and
web development, Azure development.
Step 4: After selecting the desired packages, just click the “Install” button to install.
Step 5: Once the installation is completed. Visual Studio 2022 lunched for the first
time.
Now Visual Studio has been successfully launched. When we open Visual Studio for
the first time, it takes 15-30 seconds for its initial internal setup.
Lab Task # 01
Program # 01: Write a program to print the triangle.
#include<iostream>
using namespace std;
int main()
{
cout << " *" << endl;
cout << " * *" << endl;
cout << " * *" << endl;
cout << " ********" << endl;
}
#include<iostream>
using namespace std;
int main()
{
cout << " *******"<< endl;
cout << " * *" << endl;
cout << "* *" << endl;
cout << "* *" << endl;
cout << "* *" << endl;
cout << " * *" << endl;
cout << " *******" << endl;
}
#include<iostream>
using namespace std;
int main()
{
cout << "*" << endl;
cout << "* *" << endl;
cout << "* *" << endl;
cout << "* *" << endl;
cout << "********" << endl;
}
#include <iostream>
#include<conio.h>
using namespace std;
int main()
{
int a;
cout << "Enter value of a = ";
cin >> a;
cout << "The Value of a is: " << a;
}
Program # 02: Write a program to declare a variable takes input from user
and display it then increment it by 5 and display the results.
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int a;
cout << "Enter a Value= ";
cin >> a;
cout <<"The value of 'a' is= "<< a << endl;
a = a + 5;
cout <<"The value of 'a' after increment is= "<< a << endl;
}
Output of the program:
Program # 03: Write a program which takes 2 variables having values 10 and
20 add them and print them.
#include <iostream>
using namespace std;
int main()
{
int abc = 10;
int b = 20;
int add = 0;
cout << " abc= " << abc << " b = " << b << endl; // abc =10 b= 20
cout << "add = " << add; // add= garbage value
add = abc + b;
cout << endl << " add = abc + b = " << add;
//cout<< "add = " << add ;
#include<iostream>
using namespace std;
int main()
{ int a,b,multiple;
cout<<"enter the value of a";
cin>>a;
cout<<"enter the value of b";
cin>>b;
multiple=a*b;
cout<<"a*b= "<<multiple;
}
Output:
Output:
Program # 4: Divide 2 numbers
#include<iostream>
using namespace std;
int main()
{
int a, b, div;
cout << "enter the value of a: ";
cin >> a;
cout << "enter the value of b: ";
cin >> b;
div = a / b;
cout << "a/b= " << div;
}
Output: