فصل سوم. 2 Phases of C++ Programs: 1.Edit 2.Preprocess 3.Compile 4.Link 5.Load 6.Execute Program is created in the editor and stored on disk. Preprocessor.

Slides:



Advertisements
Similar presentations
Module 6: Introduction to C Language ITEI102 Introduction to Programming Structure of C++ Program - Programming Terminologies - Microsoft Visual Studio.
Advertisements

What is a pointer? First of all, it is a variable, just like other variables you studied So it has type, storage etc. Difference: it can only store the.
Introduction to Programming Lecture 2. Today’s Lecture Software Categories Software Categories System Software System Software Application Software Application.
Definition. قانون بیز P(b|a) = P(a|b)P(b)/P(a) P(b|a) = P(a|b)P(b)/P(a) این قانون برای استنتاج آماری استفاده می شود. این قانون برای استنتاج آماری استفاده.
مثال های کاربردی (1) محاسبه سطوح دايره ای شکل –آبياری بارانی –سم پاشها تعريف مسئله: تهيه برنامه ای که بر اساس يک شعاع مفروض ورودی سطح دايره متناظر را محاسبه.
Ali Karimpour Associate Professor Ferdowsi University of Mashhad ADVANCED CONTROL Reference: Chi-Tsong Chen, “Linear System Theory and Design”, 1999.
فایل پردازی در C File based Programming in C. انواع فایل متنی –سرعت بالا –حجم کمتر –امکان دسترسی تصادفی –حفظ امنیت داده ها دودویی (باینری) –امکان باز.
AVR Microcontrollers Firsrt Session.
COMPUTER PROGRAMMING. Introduction to C++ History Merges notions from Smalltalk and notions from C The class concept was borrowed from Simular67 Developed.
1 بنام خدا زبان برنامه نویسی C (21814( Lecture 13 Chapter 13 Strings.
History of C and C++ C++ evolved from C ANSI C C++ “spruces up” C
Computer Engineering 1 nd Semester Dr. Rabie A. Ramadan 2.
Evolution and History of Programming Languages. Machine languages Assembly languages Higher-level languages To build programs, people use languages that.
Evolution and History of Programming Languages. Software Programming Language.
COMPUTER PROGRAMMING. A Typical C++ Environment Phases of C++ Programs: 1- Edit 2- Preprocess 3- Compile 4- Link 5- Load 6- Execute Loader Primary Memory.
1 بنام خدا زبان برنامه نویسی C (21814( Lecture 14 Structures.
1 Programming in C Hello World! Soon I will control the world! Soon I will control the world!
1 COMP 2130 Introduction to Computer Systems Computing Science Thompson Rivers University.
COMP519: Web Programming Autumn 2007 Perl Tutorial: The very beginning A basic Perl Program The first line Comments and statements Simple printing Running.
به نام خدا برنامه سازی سمت سرور (php)
برنامه نویسی کامپیوتر بخش ششم مدرس: دکتر خالدیان.
Lecture 1 cis208 January 14 rd, Compiling %> gcc helloworld.c returns a.out %> gcc –o helloworld helloworld.c returns helloworld.
1 CHAPTER 3 MODULAR PROGRAMMING. 2 Introduction  A library in C is a collection of general purpose and related functions.  2 types of libraries: Standard.
1 بنام خدا زبان برنامه نویسی C (21814( Lecture 9 Selected Topics.
Typical C++ Environment and Library Introduction Speaker : Wei-Lu Lin Advisor : Ku-Yaw Chang 2012/10/14.
Introduction As programmers, we don’t want to have to implement functions for every possible task we encounter. The Standard C library contains functions.
1 بنام خدا زبان برنامه نویسی C (21814( Lecture 8 Chapters 8 & 9.
موضوع: دبير مربوطه: آموزشگاه : اجرا : عبارتهای جبری خانم مقصودی
Normal Distribution بسم الله الرحمن الرحیم اردیبهشت 1390.
تمام اسب ها همرنگ هستند! Basis: h = 1 We have only one horse. Clearly all horses in the set are the same color. Inductive hypothesis: In any set of up.
Data Types Modifiers Base data type Size Sign signed int 2 B unsigned float 4 B short double 8 B long char 1 B.
Week 1 Lecture 2SE1SA51 Introducing C SE1SA5 Sue Walmsley.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 1 – Introduction to C.
Unary, Binary, logical Operations, Explicit type conversion Lecture 6 Instructor: Haya Sammaneh.
تایمر در میکروکنترلرهای AVR. تایمرها در میکروکنترلرهای AVR تایمر در حقیقت یک شمارنده است که پالس ورودی را می شمارد. در صورتی که پالس ورودی کنتور از پالس.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
1 CS 192 Lecture 4 Winter 2003 December 8-9, 2003 Dr. Shafay Shamail.
آشنايي با سيستم اعداد.
فایل ها.
به نام خدا.
CSE101-Lec#2 Programming Methodologies
Computer Engineering 1nd Semester
C Short Overview Lembit Jürimägi.
تهیه و تنظیم: فاطمه قاسمی دانشگاه صنعتی شریف – پاییز 86
تهیه و تنظیم: فاطمه قاسمی دانشگاه صنعتی شریف – پاییز 86
تمرین هفتم بسم الله الرحمن الرحیم درس یادگیری ماشین محمدعلی کیوان راد
بنام خدا زبان برنامه نویسی C (21814( Lecture 2 Chapter 3
بنام خدا زبان برنامه نویسی C (21814( Lecture 12 Selected Topics
مبانی کامپیوتر و برنامه سازی
آموزش مقدمات MATLAB سیگنال ها و سیستم ها دانشگاه صنعتی شریف پائیز 86
بنام خدا زبان برنامه نویسی C (21814( Lecture 10 Chapter 11
فصل دوم جبر بول.
פרטים נוספים בסילבוס של הקורס
1.
فصل دوم – آشنایی با زبان .NET Visual C#
آموزش کرک کردن نرم افزار ACTIVE HDL
مباني كامپيوتر و برنامه سازي
مدارهای منطقی فصل سوم - خصوصیات توابع سويیچی
بسمه تعالی.
بنام خدا زبان برنامه نویسی C (21814( Lecture 4 Chapter 5
פרטים נוספים בסילבוס של הקורס
تهیه و تنظیم: فاطمه قاسمی دانشگاه صنعتی شریف – پاییز 86
بنام خدا زبان برنامه نویسی C (21814( Lecture 7 Chapter 7
دانشگاه علم و صنعت ایران – دانشکده مهندسی کامپیوتر
فصل ششم مدارهای ترتیبی.
Programming Fundamentals Lecture #3 Overview of Computer Programming
مباني كامپيوتر و برنامه سازي Basics of Computer and Programming
مباني كامپيوتر و برنامه سازي Basics of Computer and Programming
PROGRAM AT RUNTIME Subject code: CSCI-620
Introduction to C Programming
Presentation transcript:

فصل سوم

2 Phases of C++ Programs: 1.Edit 2.Preprocess 3.Compile 4.Link 5.Load 6.Execute Program is created in the editor and stored on disk. Preprocessor program processes the code. Loader puts program in memory. CPUtakes each instruction and executes it, possibly storing new data values as the program executes. Compiler creates object code and stores it on disk. Linker links the object code with the libraries Loader Primary Memory Compiler Editor Preprocess or Linker Primary Memory Disk CPU Disk

کلمات رزرو شده زبان :c

مثال ساده :

 مهمترین توابع استاندارد:  stdio.h – file and console (also a file) IO: printf, open, close, read, write, scanf, etc.  string.h - string and byte manipulation: strlen, strcpy, strcat, memcpy, memset, etc.  errno.h – defines errno used for reporting system errors  math.h – math functions: sin, exp, floor, sqrt, etc.  time.h – time related facility: asctime, clock, time_t, etc.

دستورات ورودی و خروجی :

# include void main () { const float pi = 3.14 ; float r,p,s; printf (" please enter reduce : \n ") ; scanf("%f",&r); p = 2*pi * r ; s = pi * r *r ; printf (" The S = %f, The P = % f ", s,p) ; while(1); } مثال : برنامه ای بنویسید تا شعاع دایره را از ورودی بخواند و محیط و مساحت آنرا حساب کند و نمایش دهد.

//9 simple program # include void main() { int a=21,b=10,c; c=a%b; printf("a=%d,b=%d c=%d \n",a,b,c); int x=0xf0,y=0x0f; printf(" %x,%x, %x,%x ",x&y,x|y,y >4); getch(); }

تمرین : فرض کنید محل ذخیره آرایه float a[5]; از آدرس 0x0100 شروع می شود. تعیین کنید تا چه آدرسی به آرایه فوق اختصاص می یابد.( میکرو AVR ATMEGA 16 است )

آرایه های دو بعدی : یعنی آرایه ای از آرایه های یک بعدی مثال : فرض کنید دو آرایه یک بعدی بشکل زیر داریم : Int a[3]={1,2,3} int b[3]={4,5,6} حال می خواهیم انها را بصورت یک آرایه دو بعدی نمایش دهیم : int c[2][3]={{1,2,3},{4,5,6}} C(0,0)=1C(0,1)=2C(0,2)=3 C(1.0)=4C(1,1)=5C(1,2)=6

روش تعریف آرایه های دو بعدی : ] تعداد ستون ][ تعداد سطر [ اسم آرایه نوع متغیرها

Main() { Int i=0; HERE: i++; If (i<10) Goto HERE; Printf(“THE MAX value of i is:%d “,i); Getch(); }

مثال :

تابعی بنویسید که عددی را از ورودی بگیرد و توان 3 انرا حساب و چاب نماید

مثال 2 : تابعی بنویسید که دو عدد را از ورودی بگیرد و بزرگترین آنها را تعیین و چاب نماید