SMI S4 FSAC. Série1 Les listes chaînées. Langage C. SMI S4 Les listes chaînées & 1

Size: px
Start display at page:

Download "SMI S4 FSAC. Série1 Les listes chaînées. Langage C. SMI S4 Les listes chaînées www.sitedutout.com & www.smia.ma 1"

Transcription

1 SMI S4 FSAC Langage C Série1 Les listes chaînées Dernière modification le : 5 avril 2012 à 11h22 Correction proposée par & SMI S4 Les listes chaînées & 1

2 Exo 1 : struct cellule int val; else return (1+longeur(l->suiv)); struct cellule *suiv; ; typedef struct cellule* liste; int vide(liste l) if(l==null) return 1; else return 0; Exo 2: struct cellule int val; struct cellule *suiv; ; typedef struct cellule* liste; int longeur(liste l) int cpt=0; liste p=l; while(p!=null) cpt++; return cpt; Exo 2 Version recursive: int longeur (liste l) If (l==null) return 0; Exo 3 : struct cellule int val; struct cellule *suiv; ; typedef struct cellule* liste void en tete (liste*l,int x) liste q; q=malloc(sizeof(struct cellule)); q->val=x; q->suiv=*l; *l=q ; Exo 4 : struct cellule int val; struct cellule *suiv; ; typedef struct cellule* liste void ajoute_au_milieu (liste l,int a, int x) liste p=l, nouveau ; SMI S4 Les listes chaînées & 2

3 while(p!=null && p->val!=a) if (P!=NULL) nouveau=malloc(sizeof(struct cellule)); nouveau->val=x; nouveau->suiv=p->suiv; p->suiv=nouveau; Exo 6 : struct cellule int val; struct cellule *suiv; ; typedef struct cellule* liste void supprime_milieu (liste l,int a) liste q,p=l; Exo 5 : struct cellule int val; struct cellule *suiv;; typedef struct cellule *liste void supprimer_en_tete (liste *l) liste p; if(*l==null) printf("pas de suppression") ; else p= *l; while(p!=null && p->val!=a) if (p!=null && p->suiv!=null) q=p->suiv; p->suiv=q->suiv; free(q); l= *l->suiv; free(p); Exo 7 (1): liste position(liste l,int n) liste p=l,q; int cpt=0; if (n==0) return NULL; else while (p!=null) && (cpt!=n) SMI S4 Les listes chaînées & 3

4 q=p; cpt++; Exo 8: struct cellule int val; struct cellule *suiv;; if (cpt==n) return(q); return NULL; typedef struct cellule *liste liste concatener(liste La,liste Lb) liste p=la,q=lb; if(la==null) return q; else while(p->suiv!=null) Exo 7 (2): struct cellule int val; struct cellule *suiv; ; p->suiv=q; return la; void incrementer(liste l) liste p=l,q; if(l!=null) while(p!=null && p->val==1) q=p; p->val=0; Exo 8 Version recursive: Liste concatene(liste La, liste Lb) liste p=la; if (La==NULL) return Lb ; else p=malloc(sizeof(struct cellule)); if(p==null) p=malloc(sizeof(struct cellule)): p->val=1; p->suiv=null; q->suiv=p; else p->val=1; p->val = La->val; p->suiv=concatene(la->suiv, Lb); return p ; Exo 9: struct cellule int val; struct cellule *suiv; ; liste(creer(t[],int n) int i; liste l,p,q; l=malloc(sizeof(struct cellule); l->val=t[o]; l->occ=1; SMI S4 Les listes chaînées & 4

5 l->suivant=null; i=1; while(p!=null && p->val!=t[i]) p=p->suivant; printf( %f, &Treel[i]); for(i=0;i<10;i++) scanf( %f,&timag[i]); if(p==null) p=malloc(sizeof(struct cellule)); p->occ=1; p->suiv=l; l=p; i++; else p->occ++; i++; b- struct cellule float reel; float img; struct cellule *suiv; ; typedef struct cellule *liste return(l); Exo 10: #include<stdio.h> a- void main() struct complexe float R; float I; ; struct complexe Tab[10]; float Treel[10], Timag[10]; Int i, j=0,k=0; for(i=o;i<10;i++) Scanf( %d,&tab[i]); for(i=0;i<10;i++) if(tab[i].i==0) Treel[j]=Tab[i].R; j++; elseif(tab[i].r==0) Timag[k]=Tab[i].I; k++; for(i=0;i<10;i++) struct Rcellule float Rval; struct cellule *suivant; ; typedef struct cellule *Rliste struct Icellule float Ival; struct cellule *lien; ; typedef struct cellule *Iliste void main() liste q=l; Rliste r,k=null; liste i,f=null; while(q!=null) r=malloc(sizeof(struct Rcellule)); i=malloc(sizeof(struct Icellule)); r->suivant=k; SMI S4 Les listes chaînées & 5

6 i->lien=f; k=r; f=i; q=q->suiv; typedef struct cellule* pliste ; pliste valide(liste l) liste q=l; pliste p=null, r ; Exo 11 : a- struct cellule int cne; int un; int deux; struct cellule *suiv;; typedef struct cellule* liste; b- int valide(liste l) liste p=l; int cpt=0; while (p!=null) if(p->un=1 && p->deux=1) cpt++; while(q!=null) if(q->un==0 && q->deux==1) r=malloc(sizeof(struct pcellule)); r->pcne=q->cne; r->pun=q->cne; r->pdeux=q->cne; r->lien=p p=r q=q->suiv; Exo 12 : a- struct celf char prenom[10]; int age; struct cellule *lien;; typedef struct celf * penfant; return cpt; c- struct cellule int cne; int un; int deux; struct cellule* suiv; ; typedef struct cellule* liste; struct pcellule int pcne; int pun; int pdeux; struct cellule *lien; ; struct celm char nom[10]; int pere; int mere; penfant enfant; struct cellule *suiv; ; SMI S4 Les listes chaînées & 6

7 typedef struct celm* liste; C Version Récursive: Int nombre (liste L) b- void naissance(liste l,char N,char pren) if(l==null) return 0; liste p=l; penfant q,r; else if (L->pere ==1 && L->mere==1) while(p!=null && p->non!=n) if(p!=null) q=p->enfant ; return (1+nombre(p->suiv)); else return (nombre(l->suiv)); if(q==null) q=malloc(sizeof(struct celf)); q->prenom=pren; q->age=0; p->enfant=q ; q->lien=null ; else while(q!=null) r=q; q=q->lien; q=malloc(sizeof(struct celf)); q->age=0; q->prenon=pren; q->lien=null; r->lien=q ; c- int occ(list l) if(l==null) return 0; else if(p->pere==1 && p->mere==1) return(1+occ(l->suiv)); else return(occ(l->suiv)); Exo 13 : Int a ; do printf( Entrer un entire ); scanf( %d, &a); while(a==0) l=malloc(sizeof(struct cellule)); l->val=a; l->suiv= NULL; scanf( %d,&a); while (a!=0) q=malloc(sizeof(struct cellule)); q->val=a; p=l; while (p!=null && a>=p->val) s=p; if(p!=null) if(p==null) SMI S4 Les listes chaînées & 7

8 q->suiv=p; l=q; else s->suiv=q; elseif(p==null) q->suiv=p; Exo 15 : Void supprimer(liste *l, int x) Liste p=*l,q ; s->suiv=q; q->suiv=null; scanf( %d, &a); While(p!=NULL && p->val==x) q=p ; P=P->suiv ; If(p!=NULL) p->preced=null; Free(q); Exo 14 : Typedef struct cellulefloat val ; Struct cellule*suiv ; Strcut cellule*preced ; *liste ; Void inserer(liste l, float x, float a) liste l, nouveau ; while(p!=null && p->val!=a) if(p!=null) nouveau=malloc(sizeof(strcut clllule)) ; nouveau->val=x; *l=p While(p!=NULL) If(p->val==x) q=p; (p->preced)->suiv)=p->suiv; If(p->suiv!=NULL) ( p->suiv)->preced=p->preced; free(q); else nouveau->suiv=p->suiv; nouveau->preced=p ; p->suiv=nouveau ; if((nouveau->suiv)->preced=nouveau; SMI S4 Les listes chaînées & 8

1. Constants. 2. Variables. 3. Reserved words or key words. 4. Constants. Character set in C

1. Constants. 2. Variables. 3. Reserved words or key words. 4. Constants. Character set in C Character set in C We should use only the following characters in writing a C program. These characters can be combined to create C words. Alphabet: A, B, C, D.. Z, a, b, c, d..z Numeric digits: 0, 1,

More information

Output: 12 18 30 72 90 87. struct treenode{ int data; struct treenode *left, *right; } struct treenode *tree_ptr;

Output: 12 18 30 72 90 87. struct treenode{ int data; struct treenode *left, *right; } struct treenode *tree_ptr; 50 20 70 10 30 69 90 14 35 68 85 98 16 22 60 34 (c) Execute the algorithm shown below using the tree shown above. Show the exact output produced by the algorithm. Assume that the initial call is: prob3(root)

More information

TP : Système de messagerie - Fichiers properties - PrepareStatement

TP : Système de messagerie - Fichiers properties - PrepareStatement TP : Système de messagerie - Fichiers properties - PrepareStatement exelib.net Une société souhaite mettre en place un système de messagerie entre ses employés. Les travaux de l équipe chargée de l analyse

More information

Punctuation in C. Identifiers and Expressions. Identifiers. Variables. Keywords. Identifier Examples

Punctuation in C. Identifiers and Expressions. Identifiers. Variables. Keywords. Identifier Examples Identifiers and Expressions CSE 130: Introduction to C Programming Spring 2005 Punctuation in C Statements are terminated with a ; Groups of statements are enclosed by curly braces: { and } Commas separate

More information

M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE NOTE: IMPORTANT INSTRUCTIONS: 1. Question Paper in English and Hindi and Candidate can choose any one language. 2. In case of discrepancies in

More information

Optimizing and interfacing with Cython. Konrad HINSEN Centre de Biophysique Moléculaire (Orléans) and Synchrotron Soleil (St Aubin)

Optimizing and interfacing with Cython. Konrad HINSEN Centre de Biophysique Moléculaire (Orléans) and Synchrotron Soleil (St Aubin) Optimizing and interfacing with Cython Konrad HINSEN Centre de Biophysique Moléculaire (Orléans) and Synchrotron Soleil (St Aubin) Extension modules Python permits modules to be written in C. Such modules

More information

Pro3 1 : listes chaînées

Pro3 1 : listes chaînées Initiation à l algorithmique, L2 2005-2006, JC Fournier 3.1 Pro3 1 : listes chaînées Spécification : 1 generic 2 type element i s private ; 3 package l i s t e s c h a i n is 4 5 type position is private

More information

C Programming 1. C Programming

C Programming 1. C Programming C Programming 1 1 C Programming 1. Who developed the C language? Dennis M.Ritchie in 1972 2. What type of language is C? Semi-high level language 3. What is main()? The main() is a special function used

More information

Introduction to Programming Block Tutorial C/C++

Introduction to Programming Block Tutorial C/C++ Michael Bader Master s Program Computational Science and Engineering C/C++ Tutorial Overview From Maple to C Variables, Operators, Statements Functions: declaration, definition, parameters Arrays and Pointers

More information

Branching. We ll continue to look at the basics of writing C++ programs including. Overview

Branching. We ll continue to look at the basics of writing C++ programs including. Overview Branching Overview We ll continue to look at the basics of writing C++ programs including Boolean Expressions (need to know this before we can using branching and looping!) Branching J.S. Bradbury CSCI

More information

Pointers. C and C++ Example. Manipulating pointers

Pointers. C and C++ Example. Manipulating pointers Pointers C and C++ 3. Pointers Structures Alastair R. Beresford University of Cambridge Lent Term 28 Computer memory is often abstracted as a sequence of bytes, grouped into words Each byte has a unique

More information

Tail call elimination. Michel Schinz

Tail call elimination. Michel Schinz Tail call elimination Michel Schinz Tail calls and their elimination Loops in functional languages Several functional programming languages do not have an explicit looping statement. Instead, programmers

More information

Tutorial on C Language Programming

Tutorial on C Language Programming Tutorial on C Language Programming Teodor Rus rus@cs.uiowa.edu The University of Iowa, Department of Computer Science Introduction to System Software p.1/64 Tutorial on C programming C program structure:

More information

Lex et Yacc, exemples introductifs

Lex et Yacc, exemples introductifs Lex et Yacc, exemples introductifs D. Michelucci 1 LEX 1.1 Fichier makefile exemple1 : exemple1. l e x f l e x oexemple1. c exemple1. l e x gcc o exemple1 exemple1. c l f l l c exemple1 < exemple1. input

More information

The Queue Data Structure in C++ By Eric Suh

The Queue Data Structure in C++ By Eric Suh The Queue Data Structure in C++ By Eric Suh http://www.cprogramming.com/tutorial/computersciencetheory/queue.html Queues are data structures that, like the stack, have restrictions on where you can add

More information

SYSTEMS PROGRAMMING C++ INTRODUCTION

SYSTEMS PROGRAMMING C++ INTRODUCTION Faculty of Computer Science / Institute of Systems Architecture / Operating Systems SYSTEMS PROGRAMMING C++ INTRODUCTION Alexander Warg WHY C++? C++ is the language that allows to express ideas from the

More information

E ROADS Number of lanes end/fin 1990 end/fin 1995 ROUTES E Nombre de voices 254.3 km 244.8 a) Up to/jusqu'a 5.99m TOTAL. Normal

E ROADS Number of lanes end/fin 1990 end/fin 1995 ROUTES E Nombre de voices 254.3 km 244.8 a) Up to/jusqu'a 5.99m TOTAL. Normal Country/Pays: R.Macedonia I. E - 65.. By width of ROUTES E Nombre de voices 5. km.8 a) Up to/jusqu'a 5.99m b) 6m - 6.99m 66.5 66.5 75.5 66.0.. Selon la c) 7m - 8.99m d) 9m - 0.9m f) m -.99m g) m and over

More information

The C Programming Language course syllabus associate level

The C Programming Language course syllabus associate level TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming

More information

C Programming Dr. Hasan Demirel

C Programming Dr. Hasan Demirel C How to Program, H. M. Deitel and P. J. Deitel, Prentice Hall, 5 th edition (3 rd edition or above is also OK). Introduction to C Programming Dr. Hasan Demirel Programming Languages There are three types

More information

Each item in the list is examined in the order it occurs in the list until the desired item is found or the end of the list is reached.

Each item in the list is examined in the order it occurs in the list until the desired item is found or the end of the list is reached. Selection / linear search Each item in the list is examined in the order it occurs in the list until the desired item is found or the end of the list is reached. start 1 3 5 6 8 12 list struct email **list;

More information

Remote Method Invocation

Remote Method Invocation 1 / 22 Remote Method Invocation Jean-Michel Richer jean-michel.richer@univ-angers.fr http://www.info.univ-angers.fr/pub/richer M2 Informatique 2010-2011 2 / 22 Plan Plan 1 Introduction 2 RMI en détails

More information

A Quick Reference to C Programming Language

A Quick Reference to C Programming Language A Quick Reference to C Programming Language Structure of a C Program #include(stdio.h) /* include IO library */ #include... /* include other files */ #define.. /* define constants */ /* Declare global

More information

Pallab Dasgupta. Linked Lists CS10001: Programming & Data Structures. Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur

Pallab Dasgupta. Linked Lists CS10001: Programming & Data Structures. Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Linked Lists CS10001: Programming & Data Structures Pallab Dasgupta Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Arrays: pluses and minuses + Fast element access. -- Impossible

More information

POB-JAVA Documentation

POB-JAVA Documentation POB-JAVA Documentation 1 INTRODUCTION... 4 2 INSTALLING POB-JAVA... 5 Installation of the GNUARM compiler... 5 Installing the Java Development Kit... 7 Installing of POB-Java... 8 3 CONFIGURATION... 9

More information

CSI 333 Lecture 2 Introduction to C: Part I 2 1 / 16

CSI 333 Lecture 2 Introduction to C: Part I 2 1 / 16 CSI 333 Lecture 2 Introduction to C: Part I 2 1 / 16 Basics of C Remark: Skim Chapters 1 through 6 of Deitel & Deitel. You will notice the following: C is (more or less) a subset of Java. (So, you are

More information

Programming and Data Structures

Programming and Data Structures Programming and Data Structures Tutorial sheet: 2 Topics: Decision Making, Looping and Branching Q 1. (a) What is wrong with the following loop while ( n

More information

OPTIMAL BINARY SEARCH TREES

OPTIMAL BINARY SEARCH TREES OPTIMAL BINARY SEARCH TREES 1. PREPARATION BEFORE LAB DATA STRUCTURES An optimal binary search tree is a binary search tree for which the nodes are arranged on levels such that the tree cost is minimum.

More information

Abstract Data Types in C

Abstract Data Types in C Abstract Data Types in C Abstract Data Types (ADTs) in C (1) C is not object-oriented, but we can still manage to inject some object-oriented principles into the design of C code. For example, a data structure

More information

Modifier le texte d'un élément d'un feuillet, en le spécifiant par son numéro d'index:

Modifier le texte d'un élément d'un feuillet, en le spécifiant par son numéro d'index: Bezier Curve Une courbe de "Bézier" (fondé sur "drawing object"). select polygon 1 of page 1 of layout "Feuillet 1" of document 1 set class of selection to Bezier curve select Bezier curve 1 of page 1

More information

Molecular Dynamics Simulations with Applications in Soft Matter Handout 7 Memory Diagram of a Struct

Molecular Dynamics Simulations with Applications in Soft Matter Handout 7 Memory Diagram of a Struct Dr. Martin O. Steinhauser University of Basel Graduate Lecture Spring Semester 2014 Molecular Dynamics Simulations with Applications in Soft Matter Handout 7 Memory Diagram of a Struct Friday, 7 th March

More information

Stacks. Linear data structures

Stacks. Linear data structures Stacks Linear data structures Collection of components that can be arranged as a straight line Data structure grows or shrinks as we add or remove objects ADTs provide an abstract layer for various operations

More information

Model Answer for Basic Programming in C

Model Answer for Basic Programming in C Part A Model Answer for Basic Programming in C 1. a ANS. An algorithm is a procedure or formula for solving a problem. OR It is a step by step solution of a well-defined problem. // Algorithm to the biggest

More information

3/13/2012. Esc101: Strings. String input and output. Array of characters: String

3/13/2012. Esc101: Strings. String input and output. Array of characters: String Esc101: Strings Instructor: Krithika Venkataramani Semester 2, 2011-2012 The contents of most of these slides are from the lecture slides of Prof. Arnab Bhattacharya 1 2 Array of characters: String String

More information

drop table Aeroport cascade constraints; create table Aeroport ( codeaeroport char(3), -- Utilisé le code IATA

drop table Aeroport cascade constraints; create table Aeroport ( codeaeroport char(3), -- Utilisé le code IATA ------------------------------------------------------------ -- Universite de Sherbrooke -- Sarah Lamothe, Matricule 14080601 -- Simon Therrien, Matricule 14058814 -- IFT187 - Travail pratique 1 partie

More information

Tutorial No. 8 - Solution (Strings and User Defined Functions)

Tutorial No. 8 - Solution (Strings and User Defined Functions) Tutorial No. 8 - Solution (Strings and User Defined Functions) 1. Explain strcat( ), strcpy( ),strncmp( ) and strstr( ) string manipulation function. [6] strcat() Function: The strcat function joins two

More information

Technical Service Bulletin

Technical Service Bulletin Technical Service Bulletin FILE CONTROL CREATED DATE MODIFIED DATE FOLDER OpenDrive 02/05/2005 662-02-25008 Rev. : A Installation Licence SCO sur PC de remplacement English version follows. Lors du changement

More information

Common Errors in C. David Chisnall. February 15, 2011

Common Errors in C. David Chisnall. February 15, 2011 Common Errors in C David Chisnall February 15, 2011 The C Preprocessor Runs before parsing Allows some metaprogramming Preprocessor Macros Are Not Functions The preprocessor performs token substitution

More information

Lecture 18-19 Data Types and Types of a Language

Lecture 18-19 Data Types and Types of a Language Lecture 18-19 Data Types and Types of a Language April 29, 2014 Data Types and Types of a Language Data, Data Types and Types Type: Generalities Type Systems and Type Safety Type Equivalence, Coercion

More information

Do not open the exam until instructed

Do not open the exam until instructed Ryerson University Department of Computer Science CPS125 Winter 2009 Final Exam April 27, 2009 12 p.m. - Duration: 120 minutes Family Name: Given Name: Student #: Section number : Your Ryerson E-mail:

More information

Programming for MSc Part I

Programming for MSc Part I Herbert Martin Dietze University of Buckingham herbert@the-little-red-haired-girl.org July 24, 2001 Abstract The course introduces the C programming language and fundamental software development techniques.

More information

Thursday, February 7, 2013. DOM via PHP

Thursday, February 7, 2013. DOM via PHP DOM via PHP Plan PHP DOM PHP : Hypertext Preprocessor Langage de script pour création de pages Web dynamiques Un ficher PHP est un ficher HTML avec du code PHP

More information

C++FA 5.1 PRACTICE MID-TERM EXAM

C++FA 5.1 PRACTICE MID-TERM EXAM C++FA 5.1 PRACTICE MID-TERM EXAM This practicemid-term exam covers sections C++FA 1.1 through C++FA 1.4 of C++ with Financial Applications by Ben Van Vliet, available at www.benvanvliet.net. 1.) A pointer

More information

Arrays. Arrays, Argument Passing, Promotion, Demotion

Arrays. Arrays, Argument Passing, Promotion, Demotion Arrays Arrays, Argument Passing, Promotion, Demotion Review Introduction to C C History Compiling C Identifiers Variables Declaration, Definition, Initialization Variable Types Logical Operators Control

More information

4. OTTAWA REGIONAL CANCER FOUNDATION LOAN REPAYMENT EXTENSION

4. OTTAWA REGIONAL CANCER FOUNDATION LOAN REPAYMENT EXTENSION 30 COMITÉ DES FINANCES ET DU 4. OTTAWA REGIONAL CANCER FOUNDATION LOAN REPAYMENT EXTENSION PROLONGATION DU DÉLAI DE REMBOURSEMENT DU PRÊT CONSENTI À LA FONDATION DU CANCER DE LA RÉGION D OTTAWA COMMITTEE

More information

Algorithms and Data Structures Exercise for the Final Exam (17 June 2014) Stack, Queue, Lists, Trees, Heap

Algorithms and Data Structures Exercise for the Final Exam (17 June 2014) Stack, Queue, Lists, Trees, Heap Algorithms and Data Structures Exercise for the Final Exam (17 June 2014) Stack, Queue, Lists, Trees, Heap Singly linked list (1) Data about exam results are stored into a singly linked list. Each list

More information

C programming examples. Prof. Gustavo Alonso Computer Science Department ETH Zürich

C programming examples. Prof. Gustavo Alonso Computer Science Department ETH Zürich C prgramming examples Prf. Gustav Alns Cmputer Science Department ETH Zürich alns@inf.ethz.ch http://www.inf.ethz.ch/department/is/iks/ Prgramming examples in C Dynamic queue Use f timing functins Generating

More information

Lecture 12 Doubly Linked Lists (with Recursion)

Lecture 12 Doubly Linked Lists (with Recursion) Lecture 12 Doubly Linked Lists (with Recursion) In this lecture Introduction to Doubly linked lists What is recursion? Designing a node of a DLL Recursion and Linked Lists o Finding a node in a LL (recursively)

More information

CS 241 Data Organization Coding Standards

CS 241 Data Organization Coding Standards CS 241 Data Organization Coding Standards Brooke Chenoweth University of New Mexico Spring 2016 CS-241 Coding Standards All projects and labs must follow the great and hallowed CS-241 coding standards.

More information

Aucune validation n a été faite sur l exemple.

Aucune validation n a été faite sur l exemple. Cet exemple illustre l utilisation du Type BLOB dans la BD. Aucune validation n a été faite sur l exemple. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data;

More information

TP N 10 : Gestion des fichiers Langage JAVA

TP N 10 : Gestion des fichiers Langage JAVA TP N 10 : Gestion des fichiers Langage JAVA Rappel : Exemple d utilisation de FileReader/FileWriter import java.io.*; public class Copy public static void main(string[] args) throws IOException File inputfile

More information

MIT Aurangabad FE Computer Engineering

MIT Aurangabad FE Computer Engineering MIT Aurangabad FE Computer Engineering Unit 1: Introduction to C 1. The symbol # is called a. Header file c. include b. Preprocessor d. semicolon 2. The size of integer number is limited to a. -32768 to

More information

Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void

Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void 1. Explain C tokens Tokens are basic building blocks of a C program. A token is the smallest element of a C program that is meaningful to the compiler. The C compiler recognizes the following kinds of

More information

BSc (Hons) Computer Science with Network Security, BSc (Hons) Business Information Systems, BSc (Hons) Mathematics & BSc (Hons) Software Engineering

BSc (Hons) Computer Science with Network Security, BSc (Hons) Business Information Systems, BSc (Hons) Mathematics & BSc (Hons) Software Engineering BSc (Hons) Computer Science with Network Security, BSc (Hons) Business Information Systems, BSc (Hons) Mathematics & BSc (Hons) Software Engineering Cohort: BCNS/07/FT- BIS/07/FT- BIS/06/FT -BM/07/FT BSE/07/FT/PT-

More information

"Internationalization vs. Localization: The Translation of Videogame Advertising"

Internationalization vs. Localization: The Translation of Videogame Advertising Article "Internationalization vs. Localization: The Translation of Videogame Advertising" Raquel de Pedro Ricoy Meta : journal des traducteurs / Meta: Translators' Journal, vol. 52, n 2, 2007, p. 260-275.

More information

C Dynamic Data Structures. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell

C Dynamic Data Structures. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell C Dynamic Data Structures University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell Data Structures A data structure is a particular organization of data in memory. We want to

More information

LECTURE NOTE on PROGRAMMING IN C

LECTURE NOTE on PROGRAMMING IN C LECTURE NOTE on PROGRAMMING IN C COURSE CODE: MCA 101 By Asst. Professor Mrs Etuari Oram Asst. Prof. Mr Bighnaraj Naik SYLLABUS Module I C Language Fundamentals. Character set, Identifiers, keyword, data

More information

CSE 211: Data Structures Lecture Notes VII

CSE 211: Data Structures Lecture Notes VII CSE 211: Data Structures Lecture Notes VII LINKED LISTS In the previous lectures we have seen the representation of ordered lists using an array and sequential mapping. These representations had the property

More information

International Journal Of Engineering Research & Management Technology

International Journal Of Engineering Research & Management Technology International Journal Of Engineering Research & Management Technology ISSN: 2348-4039 September- 2014 Volume 1, Issue-5 Dynamic Implementation Using Linked List Karuna Department of Information and Technology

More information

1. What is the output of this program?

1. What is the output of this program? 1. What is the output of this program? char *ptr; char string[] = "How are you?"; ptr = string; ptr += 4; printf("%s",ptr); (a) How are you? (b) are you? (c) are (d) No output 2. Which of the following

More information

Exam in EDAA25 C Programming

Exam in EDAA25 C Programming Exam in EDAA25 C Programming October 30, 2014, 14-19 Inga hjälpmedel! Examinator: Jonas Skeppstedt Grading instructions In general: assess if a function or program works as intended while ignoring syntax

More information

St S a t ck a ck nd Qu Q eue 1

St S a t ck a ck nd Qu Q eue 1 Stack and Queue 1 Stack Data structure with Last-In First-Out (LIFO) behavior In Out C B A B C 2 Typical Operations Pop on Stack Push isempty: determines if the stack has no elements isfull: determines

More information

GSAC CONSIGNE DE NAVIGABILITE définie par la DIRECTION GENERALE DE L AVIATION CIVILE Les examens ou modifications décrits ci-dessous sont impératifs. La non application des exigences contenues dans cette

More information

Installation procedure And Technical specifications

Installation procedure And Technical specifications Installation procedure And Technical specifications 1. Required configuration Minimum Windows version : XP SP3 Minimum Framework.Net version : 4 Minimum Internet Explorer version : 9 Minimum Java version

More information

Laboratory Module 4 Height Balanced Trees

Laboratory Module 4 Height Balanced Trees Laboratory Module 4 Height Balanced Trees Purpose: understand the notion of height balanced trees to build, in C, a height balanced tree 1 Height Balanced Trees 1.1 General Presentation Height balanced

More information

The Basics of C Programming. Marshall Brain

The Basics of C Programming. Marshall Brain The Basics of C Programming Marshall Brain Last updated: October 30, 2013 Contents 1 C programming 1 What is C?................................. 2 The simplest C program, I........................ 2 Spacing

More information

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";! SET time_zone = "+00:00";!

SET SQL_MODE = NO_AUTO_VALUE_ON_ZERO;! SET time_zone = +00:00;! -- phpmyadmin SQL Dump -- version 4.1.3 -- http://www.phpmyadmin.net -- -- Client : localhost -- Généré le : Lun 19 Mai 2014 à 15:06 -- Version du serveur : 5.6.15 -- Version de PHP : 5.4.24 SET SQL_MODE

More information

REQUEST FORM FORMULAIRE DE REQUÊTE

REQUEST FORM FORMULAIRE DE REQUÊTE REQUEST FORM FORMULAIRE DE REQUÊTE ON THE BASIS OF THIS REQUEST FORM, AND PROVIDED THE INTERVENTION IS ELIGIBLE, THE PROJECT MANAGEMENT UNIT WILL DISCUSS WITH YOU THE DRAFTING OF THE TERMS OF REFERENCES

More information

Introduction. GEAL Bibliothèque Java pour écrire des algorithmes évolutionnaires. Objectifs. Simplicité Evolution et coévolution Parallélisme

Introduction. GEAL Bibliothèque Java pour écrire des algorithmes évolutionnaires. Objectifs. Simplicité Evolution et coévolution Parallélisme GEAL 1.2 Generic Evolutionary Algorithm Library http://dpt-info.u-strasbg.fr/~blansche/fr/geal.html 1 /38 Introduction GEAL Bibliothèque Java pour écrire des algorithmes évolutionnaires Objectifs Généricité

More information

CSE 303: Concepts and Tools for Software Development

CSE 303: Concepts and Tools for Software Development CSE 303: Concepts and Tools for Software Development Dan Grossman Spring 2005 Lecture 25 Memory-Management Idioms Dan Grossman CSE303 Spring 2005, Lecture 25 1 No tools or rule today Review: Java and C

More information

Benin Business visa Application

Benin Business visa Application Benin Business visa Application Please enter your contact information Name: Email: Tel: Mobile: The latest date you need your passport returned in time for your travel: Benin business visa checklist Filled

More information

BSc (Hons) Business Information Systems, BSc (Hons) Computer Science with Network Security. & BSc. (Hons.) Software Engineering

BSc (Hons) Business Information Systems, BSc (Hons) Computer Science with Network Security. & BSc. (Hons.) Software Engineering BSc (Hons) Business Information Systems, BSc (Hons) Computer Science with Network Security & BSc. (Hons.) Software Engineering Cohort: BIS/05/FT BCNS/05/FT BSE/05/FT Examinations for 2005-2006 / Semester

More information

Basic Common Unix commands: Change to directory d

Basic Common Unix commands: Change to directory d Basic Common Unix commands: cd d Change to directory d mkdir d rmdir d mv f1 [f2...] d mv d1 d2 ls [d] [f...] ls -1 [f...] vi [f] emacs [f] more f cp f1 f2 mv f1 f2 rm f gcc [-o f1] f2 gnuplot Create new

More information

Control structures in C

Control structures in C Control structures in C Lecture Topics Conditional constructs Iterative constructs Examples Style Lecture materials Textbook 13.3-13.5 Homework None Machine problem MP1.1 due February 2 at 5pm submitted

More information

Licence Informatique Année 2005-2006. Exceptions

Licence Informatique Année 2005-2006. Exceptions Université Paris 7 Java Licence Informatique Année 2005-2006 TD n 8 - Correction Exceptions Exercice 1 La méthode parseint est spécifiée ainsi : public static int parseint(string s) throws NumberFormatException

More information

Linked Lists introduction. Characteristics of Linked Lists. Programming Linked Lists

Linked Lists introduction. Characteristics of Linked Lists. Programming Linked Lists To extend understanding of pointers by using them to create dynamic data structures Understand when to use a Linked List Be able to create a Linked List in C understand internals be able to program them!

More information

Module 816. File Management in C. M. Campbell 1993 Deakin University

Module 816. File Management in C. M. Campbell 1993 Deakin University M. Campbell 1993 Deakin University Aim Learning objectives Content After working through this module you should be able to create C programs that create an use both text and binary files. After working

More information

Data Structure with C

Data Structure with C Subject: Data Structure with C Topic : Tree Tree A tree is a set of nodes that either:is empty or has a designated node, called the root, from which hierarchically descend zero or more subtrees, which

More information

Introduction Les failles les plus courantes Les injections SQL. Failles Web. Maxime Arthaud. net7. Jeudi 03 avril 2014.

Introduction Les failles les plus courantes Les injections SQL. Failles Web. Maxime Arthaud. net7. Jeudi 03 avril 2014. Maxime Arthaud net7 Jeudi 03 avril 2014 Syllabus Introduction Exemple de Requête Transmission de données 1 Introduction Exemple de Requête Transmission de données 2 3 Exemple de Requête Transmission de

More information

Certificate of Incorporation Certificat de constitution

Certificate of Incorporation Certificat de constitution Request ID: 014752622 Province of Ontario Date Report Produced: 2012/10/30 Demande n : Province de ('Ontario Document produit le: Transaction ID: 0491 1 1 718 Ministry of Government Services Time Report

More information

Note concernant votre accord de souscription au service «Trusted Certificate Service» (TCS)

Note concernant votre accord de souscription au service «Trusted Certificate Service» (TCS) Note concernant votre accord de souscription au service «Trusted Certificate Service» (TCS) Veuillez vérifier les éléments suivants avant de nous soumettre votre accord : 1. Vous avez bien lu et paraphé

More information

A Linked List Example

A Linked List Example A Linked List Example http://gd.tuwien.ac.at/languages/c/programming-bbrown/c_094.htm /* linked list example */ #include #include #include #include #include

More information

AS PUBLISHED IN THE SUPPLEMENT OF THE BULLETIN OF THE CVMQ OF JULY 11, 2003, VOL. 34 N 27

AS PUBLISHED IN THE SUPPLEMENT OF THE BULLETIN OF THE CVMQ OF JULY 11, 2003, VOL. 34 N 27 AS PUBLISHED IN THE SUPPLEMENT OF THE BULLETIN OF THE CVMQ OF JULY 11, 2003, VOL. 34 N 27 RÈGLEMENT MODIFIANT LA VERSION ANGLAISE DU RÈGLEMENT 21-101 SUR LE FONCTIONNEMENT DU MARCHÉ PARTIE 1 MODIFICATIONS

More information

The University of Alabama in Huntsville Electrical and Computer Engineering CPE 112 01 Test #4 November 20, 2002. True or False (2 points each)

The University of Alabama in Huntsville Electrical and Computer Engineering CPE 112 01 Test #4 November 20, 2002. True or False (2 points each) True or False (2 points each) The University of Alabama in Huntsville Electrical and Computer Engineering CPE 112 01 Test #4 November 20, 2002 1. Using global variables is better style than using local

More information

(a) Arrays. Definition

(a) Arrays. Definition Part 3: Aggregate Data Types (a) Arrays Definition An array is a sequence of objects of a given type Therefore it is not a type of its own It is rather an organizational concept Array elements can be accessed

More information

Dept. of CSE, IIT KGP

Dept. of CSE, IIT KGP Programming in C: Basics CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Types of variable We must declare the

More information

MPATE-GE 2618: C Programming for Music Technology. Unit 1.3

MPATE-GE 2618: C Programming for Music Technology. Unit 1.3 MPATE-GE 2618: C Programming for Music Technology Unit 1.3 More operators e ++ and -- are increment and decrement operators ++i or i++ is equivalent to i = i + 1; --i or i-- is equivalent to i = i - 1;

More information

Reading Assignment. Main Program in C. K.N. King Chapter 2. K.N. King Chapter 3. K.N. King Chapter 4. K.N. King Chapter 7. Our first C program

Reading Assignment. Main Program in C. K.N. King Chapter 2. K.N. King Chapter 3. K.N. King Chapter 4. K.N. King Chapter 7. Our first C program Reading Assignment Main Program in C In C the main program is a function called main The body of the function is enclosed in left ( ) and right ( ) curly braces. K.N. King Chapter 2 K.N. King Chapter 3

More information

TP1 : Correction. Rappels : Stream, Thread et Socket TCP

TP1 : Correction. Rappels : Stream, Thread et Socket TCP Université Paris 7 M1 II Protocoles réseaux TP1 : Correction Rappels : Stream, Thread et Socket TCP Tous les programmes seront écrits en Java. 1. (a) Ecrire une application qui lit des chaines au clavier

More information

Example Solution to Exam in EDA150 C Programming

Example Solution to Exam in EDA150 C Programming Example Solution to Exam in EDA150 C Programming Janurary 12, 2011, 14-19 Inga hjälpmedel! Examinator: Jonas Skeppstedt, tel 0767 888 124 30 out of 60p are needed to pass the exam. General Remarks A function

More information

INDEX. C programming Page 1 of 10. 5) Function. 1) Introduction to C Programming

INDEX. C programming Page 1 of 10. 5) Function. 1) Introduction to C Programming INDEX 1) Introduction to C Programming a. What is C? b. Getting started with C 2) Data Types, Variables, Constants a. Constants, Variables and Keywords b. Types of Variables c. C Keyword d. Types of C

More information

Statistical NLP Spring 2008. Machine Translation: Examples

Statistical NLP Spring 2008. Machine Translation: Examples Statistical NLP Spring 2008 Lecture 11: Word Alignment Dan Klein UC Berkeley Machine Translation: Examples 1 Machine Translation Madame la présidente, votre présidence de cette institution a été marquante.

More information

Tutorial No. 5 - Solution (Decision Making and Branching)

Tutorial No. 5 - Solution (Decision Making and Branching) Tutorial No. 5 - Solution (Decision Making and Branching) 1. Explain if...if ladder with flowchart [7] The if ladder is a way of putting together ifs together when multipath decisions are involved. A multipath

More information

C for Java Programmers

C for Java Programmers C for Java Programmers CS 414 / CS 415 Niranjan Nagarajan Department of Computer Science Cornell University niranjan@cs.cornell.edu Original Slides: Alin Dobra Why use C instead of Java Intermediate-level

More information

CIS 190: C/C++ Programming. Lecture 1 Introduction and Getting Started

CIS 190: C/C++ Programming. Lecture 1 Introduction and Getting Started CIS 190: C/C++ Programming Lecture 1 Introduction and Getting Started This course will teach you the basics of C and C++ give you more programming experience be appropriate for majors and non-majors not

More information

System Calls and Standard I/O

System Calls and Standard I/O System Calls and Standard I/O Professor Jennifer Rexford http://www.cs.princeton.edu/~jrex 1 Goals of Today s Class System calls o How a user process contacts the Operating System o For advanced services

More information

Purchasing power of the euro and the French franc

Purchasing power of the euro and the French franc Purchasing power of the euro and the French franc Coefficient for the conversion of euros and francs in one year into euros and francs in another year February 2012 Le tableau proposé permet de convertir,

More information

TOURIST VISA REQUIREMENTS GHANA (Multiple Entry), TOGO and BENIN

TOURIST VISA REQUIREMENTS GHANA (Multiple Entry), TOGO and BENIN TOURIST VISA REQUIREMENTS GHANA (Multiple Entry), TOGO and BENIN Total cost One person 5 $538 Total cost Two people $1058 Cost includes, consular fees* and return shipping For delivery outside the contiguous

More information

Computer Programming. Loops(2) do-while, for

Computer Programming. Loops(2) do-while, for Computer Programming Loops(2) do-while, for Topics Repeating Statements (review) while loop (review) do-while loop for loop Infinite loops Examples Repeating Statements In many cases same operations are

More information

Introduction to C Programming S Y STEMS

Introduction to C Programming S Y STEMS Introduction to C Programming CS 40: INTRODUCTION TO U NIX A ND L I NUX O P E R AT ING S Y STEMS Objectives Introduce C programming, including what it is and what it contains, which includes: Command line

More information