Professional Documents
Culture Documents
Lab 10 - Intro To Programming
Lab 10 - Intro To Programming
Class: BEEnv2017
Date: 23-11-2017
Objective
Description
This lab is about executing programs using Microsoft Visual studio 2010.
Step 3: After selecting Microsoft Visual Studio 2010 folder there will be again an option of Microsoft
Visual Studio 2010.
Step 4: After selection of Microsoft Visual Studio 2010 a screen like this will be shown.
Step 6: In the New Project dialog box select Visual C++ from the left most column and Win32 Console
Application from the central column. On the bottom give the name of the project and click OK.
Step 8: Now choose “Console Application” and check the option “Empty Project” and then click Finish.
#include <stdio.h>
int main()
{
//Output on the screen
printf( "I am alive! Beware.\n" );
getchar();
return 0;
}
Similarly in case you want to take an input from the user, use the following statement
#include<stdio.h>
#include<conio.h>
int main()
{
int myvariable;
printf("Enter a number:");
scanf("%d",&myvariable);
printf("%d",myvariable);
getchar();
return 0;
}
Q. No 1 Write a program which asks user to enter two numbers. The program then performs
mathematical operations of addition, subtraction, multiplication and division. Finally the
program displays the result on the screen.
Q. No 2 Write a program to convert a Fahrenheit value into Celsius., by taking input from the
user.
Hint:
F=9/5(c) +32
Q. No 3 Write a program that asks the user about a number and then displays its table as output
on the console.