Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
27Activity
0 of .
Results for:
No results containing your search query
P. 1
C Examples

C Examples

Ratings: (0)|Views: 1,505|Likes:
Published by mohit20singh
give small code of c help in understand to c language.
give small code of c help in understand to c language.

More info:

Published by: mohit20singh on Jan 11, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

06/19/2013

pdf

text

original

 
C programming examples
Prof. Gustavo AlonsoComputer Science DepartmentETH Zürichalonso@inf.ethz.chhttp://www.inf.ethz.ch/department/IS/iks/ 
 
©Gustavo Alonso, ETH Zürich.C programming examples 2
Programming examples in C
o
Dynamic queue
o
Use of timing functions
o
Generating random numbers
o
Arguments and main
o
Use of static
o
Counting bits
Programming examples taken from the on-line book: 
 Programming in C UNIX System Calls and Subroutines using C http://www.cs.cf.ac.uk/Dave/C/CE.html 
 
©Gustavo Alonso, ETH Zürich.C programming examples 3
do {Menu (&choice);switch (choice) {case 1:printf ("Enter data item value to ascanf ("%d", &data);listpointer = AddItem (listpointer,break;case 2:if (listpointer == NULL)printf ("Queue empty!\n");elselistpointer = RemoveItem (listpbreak;case 3:PrintQueue (listpointer); break;case 4:break;default:printf ("Invalid menu choice - try abreak;} while (choice != 4);ClearQueue (listpointer);exit (0);} /* main */ 
 
/* */ /* queue.c */ /* Demo of dynamic data structures in C */ #include <stdio.h>#define FALSE 0#define NULL 0typedef struct {int dataitem;struct listelement *link;} listelement;void Menu (int *choice);listelement * AddItem (listelement * listpointer, int data);listelement * RemoveItem (listelement * listpointer);void PrintQueue (listelement * listpointer);void ClearQueue (listelement * listpointer);main () {listelement listmember, *listpointer;int data, choice;listpointer = NULL;

Activity (27)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
shashiss liked this
manalidubal liked this
anurag_jaypee liked this
Dinesh Babu liked this
Pyqin SaeRa liked this
Manish Kumar liked this
ravisayyes liked this
Keerthi Fame liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->