Ključne reči,identifikatori, konstante i promenljive

Slides:



Advertisements
Similar presentations
Lecture Computer Science I - Martin Hardwick The Programming Process rUse an editor to create a program file (source file). l contains the text of.
Advertisements

Variables in C Amir Haider Lecturer.
C++ Basics Variables, Identifiers, Assignments, Input/Output.
Structure of a C program
CS1061 C Programming Lecture 4: Indentifiers and Integers A.O’Riordan, 2004.
CS 192 Lecture 3 Winter 2003 December 5, 2003 Dr. Shafay Shamail.
COMPUTER PROGRAMMING. Data Types “Hello world” program Does it do a useful work? Writing several lines of code. Compiling the program. Executing the program.
C Tokens Identifiers Keywords Constants Operators Special symbols.
C-Language Keywords(C99)
Dennis Ritchie 1972 AT & T Bell laboratories (American Telephone and Telegraph) USA 1www.gowreeswar.com.
Instructor: Alexander Stoytchev CprE 185: Intro to Problem Solving (using C)
Variables and Data Types.  Variable: Portion of memory for storing a determined value.  Could be numerical, could be character or sequence of characters.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 5P. 1Winter Quarter C Programming Basics Lecture 5.
Data Structure and c K.S.Prabhu Lecturer All Deaf Educational Technology.
Gator Engineering 1 Chapter 2 C Fundamentals (Continued) Copyright © 2008 W. W. Norton & Company. All rights reserved.
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
CMSC 1041 Variables in C Declaring, Naming, Using Variables.
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
2. C FUNDAMENTALS. Example: Printing a Message /* Illustrates comments, strings, and the printf function */ #include int main(void) { printf("To C, or.
C syntax (simplified) BNF. Program ::= [ ] Directives ::= [ ] ::= | |… ::=#include > ::=#define.
C++ Lesson 1.
Asst.Prof.Dr. Tayfun ÖZGÜR
Control Statements in C
Data types Data types Basic types
LESSON 3 IO, Variables and Operators
Compiler Construction
Introduction to C Programming Language
مبانی کامپیوتر و برنامه سازی
CMSC 104, Section 4 Richard Chang
Tipovi objekata u Object Pascal-u
Računarstvo i informatika
Reserved Words.
RP3/predavanje08 Ugniježdeni tipovi Iznimke 10/11/2018
Programi,Podaci,Varijable,Računanje- Uvod
2008/10/01: Lecture 8 CMSC 104, Section 0101 John Y. Park
CMSC 104, Section 4 Richard Chang
null, true, and false are also reserved.
Објектно орјентисано програмирање
KREIRANJE OBJEKATA.
פרטים נוספים בסילבוס של הקורס
Oрганизација програма
OSNOVE PROGRAMSKOG JEZIKA C
Uvod u programiranje - matematika – X predavanje
Elementi programskog jezika PASCAL
درس برنامه‌سازي کامپيوتر
Tipovi podataka.
Variables in C Topics Naming Variables Declaring Variables
Basics of ‘C’.
Naredba Case Višestruko grananje.
פרטים נוספים בסילבוס של הקורס
Osnovni simboli jezika Pascal
Keywords.
Govt. Polytechnic,Dhangar
Variables in C Topics Naming Variables Declaring Variables
JavaScript Reserved Words
Introduction C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell.
Prof. Bhushan Trivedi Director GLS Institute of Computer Technology
Default Arguments.
Variables in C Declaring , Naming, and Using Variables.
2. Second Step for Learning C++ Programming • Data Type • Char • Float
Programming Language C Language.
Module 2 Variables, Data Types and Arithmetic
Building Blocks of C Programming Language
Variables in C Topics Naming Variables Declaring Variables
2008/10/01: Lecture 8 CMSC 104, Section 0101 John Y. Park
C Language B. DHIVYA 17PCA140 II MCA.
Variables in C Topics Naming Variables Declaring Variables
Variables in C Topics Naming Variables Declaring Variables
Variables in C Topics Naming Variables Declaring Variables
Presentation transcript:

Ključne reči,identifikatori, konstante i promenljive PROGRAMIRANJE

Ključne riječi Pišu se malim slovima!!! Prema ANSI standardu C ima sledeće 32 ključne reči: auto double int long break else switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while Pišu se malim slovima!!! Za prevodioca imaju posebno značenje!!!

Identifikator Identifikator je sekvenca velikih i malih slova, cifara, i karaktera ‘_’. ‘_’ – ne preporučuje se Koristi se za dodeljivanje imena objektima u programu (funkcije, promenljive) NIKADA NE POČINJE CIFROM!!!!!

Odrediti koji su identifikatori korektno zapisani: Alfa , a3, c_8, novavrednost 2ab,a9p,temperatura A-5 A:5 $x2 Znak – nije dozvoljen za identifikator Znak : nije dozvoljen za identifikator Znak $ nije dozvoljen za identifikator

Promenljive Podaci smešteni u memoriji računara koji se u toku izvršenja programa mogu menjati tj. kojima se mogu dodeljivati različite vrednosti U programu se označavaju pomoću identifikatora SVAKI PODATAK KOJI SE KORISTI U PROGRAMU MORA SE DEKLARISATI!!!

Primeri: imena promenljivih u jednom programu Promenljiva Promenljiva_2 2_promenljiva _promenljiva promenljiva promenljiva 3 long void // Važeća // Nevažeća, ne sme biti cifra na početku imena // Važeća, sme biti _ na početku imena // Važeće ime, razlikuje se od Promenljiva // Nevažeće ime, ne sme biti blanko // Nevažeće ime, rezervisana reč

Deklaracija promenljivih Zadaje se u obliku: tip lista_identifikatora ; Lista_identifikatora sadrži imena promenljivih tog tipa Celobrojni, Realni, Znakovni Primer: int a,b,novibroj;

Konstante Podaci čija je vrednost unapred zadata u programu i ne mogu se menjati u toku njegovog izvršenja Dva načina zadavanja konstante: #define simb_konstanta konstanta const tip simb_konstanta=vrednost; Primer: #define PI 3.14159 const float PI=3.14159;