Free Essay

Quick Reference to C Programming

In:

Submitted By lisalibra61
Words 253
Pages 2
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 variables*/)
(variable type)(variable list);
/* Define program functions */
(type returned)(function name)(parameter list)
(declaration of parameter types)
{
(declaration of local variables);
(body of function code);
}
/* Define main function*/ main ((optional argc and argv arguments))
(optional declaration parameters)
{
(declaration of local variables);
(body of main function code);
}

Comments
Format: /*(body of comment) */
Example: /*This is a comment in C*/

Constant Declarations
Format: #define(constant name)(constant value)
Example: #define MAXIMUM 1000

Type Definitions
Format: typedef(datatype)(symbolic name);
Example: typedef int KILOGRAMS;

Variables
Declarations:
Format: (variable type)(name 1)(name 2),...;
Example: int firstnum, secondnum; char alpha; int firstarray[10]; int doublearray[2][5]; char firststring[1O];

Initializing:
Format: (variable type)(name)=(value);
Example: int firstnum=5;
Assignments:
Format: (name)=(value);
Example: firstnum=5;
Alpha='a';

Unions
Declarations:
Format: union(tag)
{(type)(member name);
(type)(member name);
...
}(variable name);
Example: union demotagname
{int a; float b;
}demovarname;
Assignment:
Format: (tag).(member name)=(value); demovarname.a=1; demovarname.b=4.6;

Structures
Declarations:
Format: struct(tag)
{(type)(variable);
(type)(variable);
...
}(variable list);
Example: struct student
{int idnum; int finalgrade; char lettergrade;
} first,second,third;
Assignment:
Format: (variable name).(member)=(value);
Example: first.idnum=333; second.finalgrade=92; Operators
Symbol Operation Example
+,-,*,/ arithmetic 1 = b + c;
% mod a = b % c;
> greater than if (a > b)
>= greater than or equal if (a >= b)
< less than if (a > 2;

Similar Documents

Premium Essay

C++ Programming

...C++ PROGRAMMING: FROM PROBLEM ANALYSIS TO PROGRAM DESIGN FIFTH EDITION D.S. MALIK Australia  Brazil  Japan  Korea  Mexico  Singapore  Spain  United Kingdom  United States C++ Programming: From Problem Analysis to Program Design, Fifth Edition D.S. Malik Executive Editor: Marie Lee Acquisitions Editor: Amy Jollymore Senior Product Manager: Alyssa Pratt Editorial Assistant: Zina Kresin Content Project Manager: Matthew Hutchinson Art Director: Faith Brosnan Print Buyer: Julio Esperas Cover Designer: Roycroft Design/ www.roycroftdesign.com Cover Photo: ª Guntmar Fritz/Masterfile Proofreader: Green Pen QA Indexer: Elizabeth Cunningham Compositor: Integra ª 2011 Course Technology, Cengage Learning ALL RIGHTS RESERVED. No part of this work covered by the copyright herein may be reproduced, transmitted, stored or used in any form or by any means graphic, electronic, or mechanical, including but not limited to photocopying, recording, scanning, digitizing, taping, Web distribution, information networks, or information storage and retrieval systems, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the publisher. For product information and technology assistance, contact us at Cengage Learning Customer & Sales Support, 1-800-354-9706 For permission to use material from this text or product, submit all requests online at www.cengage.com/permissions Further permissions questions can be...

Words: 11776 - Pages: 48

Premium Essay

Unit 1 Res

...powerful state as shown by some of the newer examples in more recent years. This is not to say that more recent additions are necessarily better, just more specialized and optimized for particular functions and environments. A few notable examples include Pascal, C#, Java, Ruby, and Visual Basic. Pascal is an interpretive language published in 1970 by swiss programmer Niklaus Wirth. It is named for French mathematician Blaise Pascal, and was intended to be a compact, efficient language. Pascal’s structure is designed to encourage good programing practices and be easy to learn. C# or C sharp is a simple, modern, general-purpose, object-oriented programming language that is intended to run in Microsoft’s .Net framework. It was first published around 2000, with its latest update C# 6.0, having been released on 6/20/2015. One of the goals of C# is to be easy to learn to those already familiar with C and C++. Java was developed by Sun Microsystems and published by the Oracle Corporation. It first appeared in 1995, and its most recent stable release was 10/15/2015. It is intended to be executable on any compatible device without needing to be recompiled, and is very widely used. Much of java is derived from C and C++, however it has fewer lower level facilities than either. Ruby is a dynamic, reflective, object orientated programing language developed in the mid to late 1990’s by Yukihiro Matsumoto. It is used mostly for programs that run on web servers, and its last stable...

Words: 494 - Pages: 2

Premium Essay

Facebook

...Facebook Discussion Questions 1. How does Facebook’s privacy management of users’ personal information affect the behavior of Facebook patrons? = Well, Facebook, generates most of its revenue from targeted advertisements based on user’s demography and interest, so the more data users share publicly the more money it can mint from ads (Nelson & Quick, 2013). Let’s say for example I don’t publish my likes and dislikes on Facebook. Then they will have to find a way to push me into doing that. The moment I go in and enter that information I will be immediately targeted as a consumer with certain needs and Facebook will be the platform that will bring them to me. 2. Being a college student you are likely a Facebook user. What is your opinion regarding how Facebook deals with privacy issues? What have you done (or decided not to do) with regard to protecting your privacy on Facebook (or other social networking sites)? =As a college student I do have a Facebook. In my opinion, if Facebook is seeking to become dominant on the internet they should follow through on providing privacy for its users and personal choice. I don’t agree that as a user, you really don’t have control of the privacy in your page. Even though I have a page, I don’t like to post all my information there or any other social networking site. I have never believed that you are totally protected. I always recommended my family and close friends not to put personal data (phone number, address, private...

Words: 1267 - Pages: 6

Premium Essay

Nonmarket Issues

...SECTION 3 OBJECTIVES In Section 3, you will What Factors Affect Supply? KEY TERMS change in quantity supplied, p. 146 change in supply, p. 148 input costs, p. 148 labor productivity, p. 149 technology, p. 149 excise tax, p. 149 regulation, p. 150 TA K I N G N O T E S As you read Section 3, complete a chart like this one showing each factor that causes change in supply. Use the Graphic Organizer at Interactive Review @ ClassZone.com Factor That Changes Supply Reason Why Supply Changes • explain the difference between change in quantity supplied and change in supply • understand how to determine a change in supply • identify the factors that can cause a change in supply Changes in Quantity Supplied KE Y CON CE P T S QUICK REFERENCE Change in quantity supplied is a rise or fall in the amount producers offer for sale because of a change in price. The supply schedules and supply curves that you studied in Section 1 were created using the assumption that all other economic factors except the price of tomatoes would remain the same. If all other factors remain the same, then the only thing that influences how many tomatoes producers will offer for sale is the price of those tomatoes. The supply curve shows that pattern. In Chapter 4, you learned the difference between change in demand and change in quantity demanded. Change in quantity demanded is shown by the points along an existing demand curve, while change in demand actually shifts the demand curve itself. Similarly, the...

Words: 3373 - Pages: 14

Free Essay

Planning, Controlling, Leading, Organizing

...PROFESSIONAL PROFILE A committed and proactive professional who specialises in the use of embedded design and programming techniques to develop creative and innovative robotic systems tailored towards specific project requirements. Quick to assimilate new ideas, concepts and cutting-edge technologies whilst demonstrating a logical and analytical approach to solving complex problems and issues. Able to work well on own initiative while demonstrating the organisation and prioritisation required to achieve tight deadlines and deliverables. A motivational and inspirational leader who enjoys being part of a successful and productive team, and thrives in highly pressurised and challenging working environments. OBJECTIVE Currently looking for a new and challenging position, one which will make best use of existing skills and experience while enabling further personal and professional development. EDUCATION AND QUALIFICATIONS MSc Embedded Systems and Robotics – Distinction (2003) Thesis: Compact Motion Tracking System for Human Rehabilitation BSc Computer Science with Robotics & Intelligent Machines – 2.1 (2002) Thesis: 2D Mapping Mobile Robots in Unstructured Environments College Courses Mathematics, Mechatronic Systems, Applied Dynamics and Electrical Control Theory KEY TECHNICAL SKILLS • Assembler, Embedded C, C++, Visual MFC, Linux, Java, OpenGL, Handle-C and VHDL CAREER SUMMARY 2005–date Mobile Robotics Ltd, London SENIOR RESEARCH ASSISTANT • Playing...

Words: 573 - Pages: 3

Free Essay

Vivek

...ac.in SCHEME FOR POST GRADUATE DIPLOMA IN COMPUTER APPLICATIONS (PGDCA) (Effective From July 2011 Session) SEMESTER -I Subject Code Subject Name Scheme L 1PGDCA1 1PGDCA2 1PGDCA3 1PGDCA4(A) 1PGDCA4(B) Fundamentals of Computers & Information Technology Introduction to Operating Systems (Dos, Windows, Linux) PC Packages Elective - 1 Foxpro MS-Access 4 4 1 3 T P Theory Paper 80 80 Internal Evaluation 20 20 Practical Exams Total Marks 100 100 4 4 1 3 3 80 80 20 20 25 25 125 125 Semester Total 450 (*L-Lecture, T-Tutorial, P-Practical) SEMESTER –II Subject Code Subject Name Scheme L 2PGDCA1 2PGDCA2 2PGDCA3 2PGDCA4(A) 2PGDCA4(B) 2PGDCA5 System Analysis and Design Programming with Visual Basic.NET Internet & E-Commerce Elective - 2 OOPs & Programming with C++ Financial Accounting with Tally Project Work 4 4 4 4 T 1 P 3 3 3 Theory Paper 80 80 80 80 Internal Evaluation 20 20 20 20 Practical Exams Total Marks 100 125 100 125 25 1 25 4 100 Semester Total 550 General Instructions: 1. For passing the subject examination minimum 40% marks must be separately scored in Theory Paper, Practical Exams and Internal Evaluation in the subject. 2. For passing the semester, minimum aggregate marks must be 45% in the semester. Course : PGDCA Sub Code : 1PGDCA1 Semester: I Subject Name : Fundamentals of Computers & Information Technology Workshops Total Hours Field Visits Practical’s UNIT–I Brief History of Development of Computers...

Words: 4021 - Pages: 17

Premium Essay

Pt1420 Research Paper 1 Programming Languages

...Between the 1970's and the 2000's there are so many programming languages, it seems nigh impossible to list all of them. But, of course, there's always the most important or the most popular, and a lot of times the most important/most popular are the same languages, just maybe in a different order. The 1970's seen a quick advancement in computers and their languages due the the creation of the microprocessors. This era's programming history is marked by C, Pascal, Smalltalk, Scheme and Prolog The C programming language is the basis for many others. It's one of the singly most important building blocks of many of the languages used today. C was created in 1971, though it's roots go back to 1954's Fortran. However, it's direct predeccessor was B in 1969. C was created as a compiler to more easily install OS's on computers. It made it possible to the few system-dependent requirements and then use a C compiler to install the new OS. Bell Lab's Ken Thompson was behind the original B, then him and Dennis Ritchie, also of Bell Labs, improved upon it for the NB language. The evolution of NB led naturally to C. Pascal is another language that is the basis of many others, and many of the languages used commonly now have it somewhere in their developmental line. Pascal was named for Frenchman Blaise Pascal, a pioneer mathematician, that had created the first arithmetic machine. That machine could, arguably, be considered the first computer. Niklaus Wirth had written the first version...

Words: 1483 - Pages: 6

Premium Essay

Contract Creation and Management

...contract problems between Span systems and Citizen – Schwarz AG. After reviewing the simulation we have to come to the following response and conclusion to the issues at hand. Being the project manager in this simulation it would show that I would be trying to keep this contract with C-S so that we will be in the running for the other contract that may be in play. The problem that has occurred is the fact the process has not being completed at a quick enough pace for C-S and they want to get out of the contract and look into changing to another company located in India. This process is not a good move for C-S due to the fact that they have made changes and Span has compiled with every move that have made. The only problem is that Span has also had some internal programming issues that will have to be handled so that C-S can see that we are moving forward with the process. “Good negotiators do their homework. Here are some tips for making your next negotiation session productive for both you and your potential project partner” (Raterman, 2005). That is what needs to be done so that both companies can try and negotiate what can be done to ensure that this contract can be saved. Understanding what C-S needs to keep this contract and keep the communication open will help the negotiations continue towards a new contract that will suit each one...

Words: 668 - Pages: 3

Premium Essay

Java Programming Language Sl-275

...Sun Educational Services Java Programming Language SL-275 Sun Educational Services Java Programming Language September 1999 Copyright 1999 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California 94303, U.S.A. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. Sun, Sun Microsystems, the Sun Logo, Solstice, Java, JavaBeans, JDK, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK and Sun Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the...

Words: 6064 - Pages: 25

Free Essay

Abdullah

...growth oriented activities. I have sheer interest to work in an administration where I can prove myself. | Special Qualification: | Quick Learning Capability, Making electronics project, Arduino Uno Programming | Academic Qualification: | Exam Title | Concentration/Major | Institute | Result | Passing Year | B.Sc in Electrical & Electronics Engineering   | Electrical   | International Islamic University Chittagong   | CGPA:3.87 out of 4   | 2014   | Higher Secondary Certificate   | Science   | Bomoni College   | CGPA:3.40 out of 5   | 2008   | Secondary School Certificate   | Science   | Mucchapur High School   | CGPA:3.94 out of 5   | 2005   | | Training Summary: | Training Title | Topic | Institute | Country | Location | Year | Duration | Microcontroller Training   | PIC microcontroller   | Institute of Engineers Bangladesh   | Bangladesh   | Ramna   | 2013   | Two month   | | Professional Qualification: | Certification | Institute | Location | From | To | Office Mangement Course   | Icon Bangladesh Associates.   | Dhaka   | January 26, 2009   | March 26, 2009   | | Specialization: | Fields of Specialization | Description | * Electrical/Electronics * C/Turbo C * Engineers * Windows XP/7/8/8.1 * WiFi/Bluetooth * Android   | Proteus, Matlab, C++, Microcontroller, PWS, Electronics   | | Extra Curricular Activities: | Making Electronic Projects, Playing Badminton | ...

Words: 320 - Pages: 2

Free Essay

How Would I Achieve My Dream Job

...General Objective: To know and understand the addressing mode and programming. Specific Objectives: At the end of the unit you should be able to: 4.1 classify and describe the addressing modes 4.2 explain the concept of programming 4.3 discuss the implementation structure of programming 0. INTRODUCTION Programming is a process of composing several instructions to perform certain tasks. The product of the programming is called a program which contains several instructions. The skill of programming is to know the best or optimum composition of selective instructions to performs the required tasks. In other words, we may classify these skills into uniform concepts as structure of programming implementation. These structure shall bear the emphasis to: • what instructions (selectable from a complete list of instructions as a tools list) essential and best to perform a certain task; • how these instructions are organized into a sub program which can be reused or recalled as many times as possible to perform the identical task with different set of data; • to preserve the minimum lines of instruction but performs the maximum tasks. The less instruction lines require less operating times, thus expetite the implementation speed. The main proccess of program (instructions) implementation is nothing else just the manipulation of data. We need to know how to identify the source of data, procedure to fetch these...

Words: 9907 - Pages: 40

Premium Essay

Tchtimes

...book or see the short description below C is a general-purpose language which has been closely associated with the UNIX operating system for which it was developed - since the system and most of the programs that run it are written in C. Many of the important ideas of C stem from the language BCPL, developed by Martin Richards. The influence of BCPL on C proceeded indirectly through the language B, which was written by Ken Thompson in 1970 at Bell Labs, for the first UNIX system on a DEC PDP-7. BCPL and B are "type less" languages whereas C provides a variety of data types. In 1972 Dennis Ritchie at Bell Labs writes C and in 1978 the publication of The C Programming Language by Kernighan & Ritchie caused a revolution in the computing world. In 1983, the American National Standards Institute (ANSI) established a committee to provide a modern, comprehensive definition of C. The resulting definition, the ANSI standard, or "ANSI C", was completed late 1988. Error Handling (Exception Handling) in C - (page 2) In this Project file we are going to look at error handling. Although C programming does not provide direct support for error handling (also called exception handling), there are ways to do error handling. Of course the programmer needs to prevent errors during coding and should always test the return values of functions called by the program. A lot of C function calls return a -1 or NULL in case of an error, so quick test on these return values are easily done...

Words: 1229 - Pages: 5

Free Essay

Tester

...RAJANI BHASHKAR E-mail:rajanibaranwal2000@gmail.com Mobile: +91 7507578738 Objective Seeking challenging opportunity as a software test engineer with strong academic background, excellent communication, knowledge of software testing principals and automation tools like Quick Test Professional (QTP) and Selenium having certification from SEED Infotech. Summary Highly motivated and enthusiastic aspiring software tester with good knowledge in C and Java technologies. Excellent communication skills. Energetic self-starter with excellent analytical and creative skills. Selective Accomplishments * B.Tech. (Computer Science) from Karnataka University with first class. * Secured grade A+ in ‘Diploma in Software Testing’ through SEED infotech. Technical Skills Programming Languages | C, Java, SQL | Technologies | Web applications | Tools | Bugzilla, QuickTestPro (QTP)9.0, Selenium, Test Link, Quality Center | Technical Experience Internship Project Project Title | Orange HRM(New Level of HR Management) | Client | Seed Infotech | Duration | 20th April,2015 to 27th April,2015 | Technologies | Visual Basic, C, SQL Server | Roles and Responsibilities | * Writing test cases for time module * Test execution of test cases of leave module * Defect reporting | Technologies | Java | Project Title | Orange HRM and Flights | | * Prerequisites of automation * Easy record and playback * Use of various...

Words: 338 - Pages: 2

Free Essay

C Programming

...Welcome to CS 241 Systems Programming at Illinois Robin Kravets Copyright ©: University of Illinois CS 241 Staff 1 The Team  Robin Kravets    TAs   Office: 3114 SC rhk@illinois.edu Wade Fagen, Farhana Ashraf, Hilfi Alkaff and Mainak Ghosh Discussion Sections   8 sessions (Thursdays 9, 10, 11, 12, 1, 2, 3, 4) All sections in SC 0220 Copyright ©: University of Illinois CS 241 Staff 2 News and Email  Announcements and discussions: Piazza  http://www.piazza.com/illinois/cs241     All class questions This is your one-stop help-line! Will get answer < 24 hours e-mail   cs241help-fa12@cs.illinois.edu Personal questions not postable on the news group Copyright ©: University of Illinois CS 241 Staff 3 The Textbook  Introduction to Systems Concepts and Systems Programming      University of Illinois Custom Edition Copyright © 2007 Pearson Custom Publishing ISBN 0-536-48928-9 Taken from:    Operating Systems: Internals and Design Principles, Fifth Edition, by William Stallings UNIX™ Systems Programming: Communication, Concurrency, and Threads, by Kay A. Robbins and Steven Robbins Computer Systems: A Programmer's Perspective, by Randal E. Bryant and David R. O'Hallaron Copyright ©: University of Illinois CS 241 Staff 4 Your CS 241 “Mission”  Come to class     Read textbook    20% 7:00 – 9:00 PM October 15th Final  3% 47% Longer MPs are worth a little more Midterm   Reading assignments posted on webpage Homework...

Words: 1748 - Pages: 7

Free Essay

C++ Objects Solutions

...C++ LOCATION OF VIDEONOTES IN THE TEXT Chapter 1 Designing a Program with Pseudocode, p. 19 Designing the Account Balance Program, p. 24 Predicting the Output of Problem 30, p. 24 Solving the Candy Bar Sales Problem, p. 25 Using cout to Display Output, p. 32 Assignment Statements, p. 59 Arithmetic Operators, p. 61 Solving the Restaurant Bill Problem, p. 72 Using cin to Read Input, p. 75 Evaluating Mathematical Expressions, p. 81 Combined Assignment Operators, p. 102 Solving the Stadium Seating Problem, p. 151 Using an if Statement, p. 162 Using an if/else Statement, p. 172 Using an if/else if Statement, p. 175 Solving the Time Calculator Problem, p. 236 The while Loop, p. 249 The for Loop, p. 263 Nested Loops, p. 277 Solving the Ocean Levels Problem, p. 299 Defining and Calling Functions, p. 306 Using Function Arguments, p. 316 Value-Returning Functions, p. 326 Solving the Markup Problem, p. 380 Creating a Class, p. 391 Creating and Using Class Objects, p. 393 Creating and Using Structures, p. 436 Solving the Car Class Problem, p. 480 Accessing Array Elements, p. 487 Passing an Array to a Function, p. 517 Two-Dimensional Arrays, p. 526 Solving the Chips and Salsa Problem, p. 567 Performing a Binary Search, p. 580 Sorting a Set of Data, p. 587 Solving the Lottery Winners Problem, p. 616 (continued on next page) Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 LOCATION OF VIDEONOTES IN THE TEXT Chapter 10 Pointer Variables...

Words: 11246 - Pages: 45