How to start Visual Studio 2008 or 2010 (command-line program)

Slides:



Advertisements
Similar presentations
Variables in C Amir Haider Lecturer.
Advertisements

What is shape function ? shape function is a function that will give the displacements inside an element if its displacement at all the node locations.
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
TDBA66, VT-03 Lecture - Ch. 21 A complete C-program Display Fig. 2.1 and comment on different things such as Preprocessor directives Header files Identifiers.
An intro to programming concepts with Scratch Session 2 of 10 sessions I/O, variables, simple computing.
The If/Else Statement, Boolean Flags, and Menus Page 180
Basic Input/Output and Variables Ethan Cerami New York
Perimeter Rectangles, Squares, and Triangles Perimeter Measures the distance around the edge of any flat object. To find the perimeter of any figure,
Chapter 1 Pseudocode & Flowcharts
Programming is instructing a computer to perform a task for you with the help of a programming language.
Microsoft® Small Basic
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
E0001 Computers in Engineering
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
Goals of Course Introduction to the programming language C Learn how to program Learn ‘good’ programming practices.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
C How to Program, 6/e © by Pearson Education, Inc. All Rights Reserved.
CS320n –Visual Programming More LabVIEW Control Structures.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering –Intro to the Robotics –Introducing the IC –Discuss.
© Chinese University, CSE Dept. Distributed Systems / Simple Example Open Microsoft Visual Studio 2005:
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
More While Loop Examples CS303E: Elements of Computers and Programming.
1 CSC103: Introduction to Computer and Programming Lecture No 7.
Topic 3 – The General Form of a C Program. CISC 105 – Topic 3 The General Form of a C Program Now, all of the basic building blocks of a C program are.
Perimeter = 2*(length+width)
A First C Program /* Print a Message */ #include main() { printf("This is a test!\n"); } The program is compiled and run as cc pg32.c  a.out  This is.
C Programming Lecture 5 : Basic standard I/O Lecture notes : courtesy of Ohio Supercomputing Center, science and technolgy support.
Practice with Area, Perimeter and Circumference Sometimes we have to find area or perimeter of odd shapes. Find the area of the following shape. 15 m.
Lecture 4: Calculating by Iterating. The while Repetition Statement Repetition structure Programmer specifies an action to be repeated while some condition.
CS140: Intro to CS An Overview of Programming in C (part 3) by Erin Chambers.
1 C++ Programming Basics Chapter 1 Lecture CSIS 10A.
Circumference Lesson #33. What is Circumference? The distance around the outside of a circle is called the circumference (essentially, it is the perimeter.
C OMPUTER P ROGRAMMING 1 Assignment. A SSIGNMENT We have used gets to input a value into variable The second way to give a variable a value is known as.
1 Original Source : and Problem and Problem Solving.ppt.
© T Madas. Find the mean percentage mark of 37%, 42%, 68%, 55% and 39%. Find of Find 7% of 675. Find the area of a triangle with base of 1.25.
Exercise 3 Example> Write a C function that implements /* input : integer value n output : */ int f ( int n ) { int i, sum=0; for (i=1;i
1 Lab Session-IV CSIT121 Spring 2002 Some Questions Scope of Variables Top Down Design Problem The Solution Lab Exercises Lab Exercise for Demo.
Lecture 5: Expressions and Interactivity Professor: Dr. Miguel Alonso Jr. Fall 2008 CGS2423/COP1220.
Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
1 CSC103: Introduction to Computer and Programming Lecture No 16.
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
CMSC 104, Version 8/061L09VariablesInC.ppt Variables in C Topics Naming Variables Declaring Variables Using Variables The Assignment Statement Reading.
Perimeter, Circumference and Area. Perimeter and Circumference Perimeter : The distance around a geometric figure. Circumference: The distance around.
Sudeshna Sarkar, IIT Kharagpur 1 Programming and Data Structure Sudeshna Sarkar Lecture 3.
NOTE: C programs consist of functions one of which must be main. C programs consist of functions one of which must be main. Every C program begins executing.
Circles Shape and Space. The value of π For any circle the circumference is always just over three times bigger than the radius. The exact number is called.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
Lecture 2. Algorithms and Algorithm Convention 1.
Exercise 2 : Using for loop Repetition (loop) (1)control variable initialization (2)Test Conditon (3)Modification of control variable value order : (1)
Basic concepts of C++ Presented by Prof. Satyajit De
INC 161 , CPE 100 Computer Programming
Administrative things
Use proper case (ie Caps for the beginnings of words)
פרטים נוספים בסילבוס של הקורס
פרטים נוספים בסילבוס של הקורס
Preprocessor.
Lab 1 Introduction to C++.
An intro to programming concepts with Scratch
Our Environment We will exercise on Microsoft Visual C++ v.6
Introduction to C Programming
Variables in C Topics Naming Variables Declaring Variables
CSCE 206 Lab Structured Programming in C
Administrative things
Lecture 20 – Practice Exercises 4
Preprocessor Directives and Macros Chapter 21
Presentation transcript:

How to start Visual Studio 2008 or 2010 (command-line program)

Run Visual Studio 2008 and create new project

1.Select console application 2.Insert project name 3.Click OK

Visual Studio 2008 Creating Command-Line Program 4.Click “Next” 5. Select 6.Click “Finish”

Visual Studio 2008 Creating Command-Line Program 7.Click Mouse-right-button ex1-1.c 8.Insert the name of C source file “ex1-1.c”

Visual Studio 2008 Creating Command-Line Program

Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add a new C file to the project. 3.Write following simple C code 4.Build (F7) 5.Execute (Ctrl F5)

Exercise 1

1(a). Write a program that will obtain the length and width of a rectangle from the user and compute its area and perimeter. (Use float type for all variables.) Output Example : (  keyboard user input) ,

1(b). Write a program that reads in the radius(반지름) of a circle and prints the circle’s diameter(지름), circumference(둘레), and area(면적). Use the constant value for PI. #include int main() { float radius, diameter, circumference, area; // put your code here // use scanf to get the value of radius // use printf to display the result of calculation. } Output Example : Get radius? 3.5 diameter = , circumference = , area =

2. Given the values of the int type variables x, y and z, write a program to rotate their values such that x has the value of y, y has the value of z, and z has the value of x. Output Example : (  ---- keyboard user input) 1 6 3

3(b). Write a program to read three integer numbers from keyboard and print out the largest number and the smallest number. (Use if-else statements.) 3(a). Write a program that determines whether a given (user input) integer is odd or even and displays the number and description on the same line. Ex) if (a>b) { … } else { … }