Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
College aantekeningen

Class notes Bachelor in Technology (TCS-101)

Beoordeling
-
Verkocht
1
Pagina's
50
Geüpload op
24-01-2022
Geschreven in
2021/2022

computerized notes of C language and operators and well handwritten notes of calculus

Instelling
Vak

Voorbeeld van de inhoud

UNIT-II

INTRODUCTION TO C PROGRAM & OPERATORS


Topics: First C program - Hello world, How to open a command prompt on
Windows or Linux How to read and print on screen - printf(), scanf(), getchar(),
putchar() Variables and Data types - Variables, Identifiers, data types and sizes,
type conversions, difference between declaration and definition of a variable,
Constants.

Life cycle of a C program (Preprocessing, Compilation, Assembly, Linking, Loading,
Execution), Compiling from the command line, Macros.

Operators – equality and assignment, Compound assignment operators, Increment
and decrement operators, Performance comparison between pre and post
increment/decrement operators, bitwise operators (AND, OR, NOT and XOR),
Logical Operators, comma operator, precedence and associativity, Logical
operators (AND, OR,NOT).

,Why Program Computers?
 Computer is a machine. Depends onInstructions to accomplish something.
 Correct Instructions results expectedoutput.
 Series of meaningful instructions is aprogram.
 People who write these instructionsknown as programmers.
 Cooking dish certain steps arefollowed. Particularorder, quantity etc.Same in
computer programming Wronginstruction, did not give thedesired result.
 On RUNNING/EXECUTING a computerprogram we get desired output
 You need a COMPILER to run a programon a computer. It makes a program
understandable to acomputer.Since Computer can understand only 0sand 1s
 COMPILATION or BUILD is the processof making a program executable on
acomputer
 Program written in high level languagecalled a SOURCE CODE.
 Compiler transforms to MACHINE CODE
 We shall use Code::Blocks/Online GDB/Dev C++ Compiler for typing, editing,
debuggingand executing a program.

Terminology
 Integrated developmentenvironment (IDE) seethe program output in one place
with an IDE .Example:Code::blocks, Eclipse, Visual Studio
 Editor
 Compilation
 Debugging: Removing them called debugging.
 Errors in code called as Bugs.

Introduction
We all program our lives in some way.Computer Program is a list ofInstructions

Example Program: ISBT (Inter State BusTerminus) to Graphic Era Univesity,Dehradun
 Head west on NH 7 toward ISBT Circle
 At ISBT Circle, take the 1st exit ontoNH307 2 Kms
 Turn left onto Post Office Rd 1 Kms
 Turn right onto Bell Road 200 Metres
 Make a left towards Graphic EraUniversity

Let us say your parents give you onethousand rupees per month towards
yourexpenses. Assume you hobby is listening tomusic and you purchase them from
awebsite selling songs. Let us say the cost ofa song is 12 rupees.Now you want to write
a simple program totell you the total cost for say N number ofsongs you download
from the site. If youhad to write the steps they would be…

, Enter “Number of songs you wouldlike to download today?” N
Enter “the cost per song:” 12
Multiply the Number of songs withcost per song: N x 12
Show the final cost: Rs. ______

 This sequence of instructions is aprogram.
 Now computer programs are similarbut have a SYNTAX and written insome
programming language.
 Computer languages may specify thatend of each statement be followed bya
special character like say ; in C
 Failure to use the terminating ; leadsto syntax error message
 Every language has its unique syntax
 Above statements in blue Consolasfont are known as pseudo code
 Logic is known as SEMANTICS


// C Program
#include <stdio.h>
int main ()
{
int N_Songs ;
float Song_Cost = 12, Final_Price;
printf(“Enter Number of Songs \n”);
scanf(“%d”, &N_Songs);
Final_Price = N_Songs * Song_Cost;
printf(“Cost of Songs is %0.2f \n”,Final_Price);
return 0;
}

Key parts of a program
 Variables and Constant
 Name and types of values
 Variables vary and contain value(s)
 Names for Memory location
 Operators = *
 Data type Character and Non-Character
 Must Declare memory locations to bereserved

, Why Learn C Programming Language?
 Close to 50 years still widely used
 Language that is the basis for mostmodern languages
 Understand the working of acomputer system
 Extensive applications. For example,compilers, operating systemsembedded
applications to name afew.
 Major portions of OS like Windows,Linux, UNIX still in C. Integration withnew devices
through device drivers in C.
 Embedded world mobile phones,washing machines, digital cars,cameras, IoT
applications use C.
 Games also due to speed and quickresponse
 Few languages have the ability tointeract with hardware like C
 Lean, Mean and efficient
 Lean, mean efficient language

Features of C language:
 Structured
 High Level/Middle Level
 Robust
 Portable
 Extensible
 Supports pointers

Structured:
C is structured procedure oriented language, it divides the problem into
smaller modules called functions or procedures.

High Level/Middle Level:
Programs written in C must be translated by the Compiler (system
software) into machine level language.
While in middle level languages programmers can write a code that can be
translated by the assemblers into machine code, which helps the programmers
to interact directly with the hardware.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
24 januari 2022
Aantal pagina's
50
Geschreven in
2021/2022
Type
College aantekeningen
Docent(en)
Mr.himanshu
Bevat
Alle colleges

Onderwerpen

$8.49
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
aviraldixit

Maak kennis met de verkoper

Seller avatar
aviraldixit Graphic Era University
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
1
Lid sinds
4 jaar
Aantal volgers
1
Documenten
5
Laatst verkocht
4 jaar geleden

0.0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen