PDF4PRO ⚡AMP

Modern search engine that looking for books and documents around the web

Example: quiz answers

Introduction to Programming (in C++)

Introduction to Programming (in C++)IntroductionJordi Cortadella, RicardGavald , Fernando OrejasDept. of Computer Science, UPCO utline Programming examples Algorithms, Programming languages and computer programs Steps in the design of a program2 Dept. CS, UPCI ntroduction to ProgrammingFirst program in C++#include <iostream>using namespace std;// This program reads two numbers and// writes their sumintmain() {intx, y;cin>> x >> y;ints = x + y;cout<< s << endl;} Introduction to Programming Dept. CS, UPC3 Introduction to Programming Dept. CS, UPC4cincout>sum8 1321> sum-15 9-6>Calculate xy Algorithm: repeated multiplicationx x x xIntroduction to Programming Dept. CS, UPC5ytimesyxip=xi4301431343294332743481 Calculate xy#include <iostream>using namespace std;// Input: read two integer numbers,x and y,// such that y >= 0// Output: write xyintmain() {intx, y;cin>> x >> y;inti= 0;intp = 1;while(i<y) { // Repeat several times (y)i= i+ 1;p = p x; //p = xi}cout<< p << endl;} Introduction to Programmi

Introduction to Programming (in C++) Introduction Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC. Outline •Programming examples •Algorithms, programming languages and computer programs •Steps in the design of a program

Loading..

Tags:

  Introduction, Programming

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Spam in document Broken preview Other abuse

Transcription of Introduction to Programming (in C++)

Related search queries