Beruflich Dokumente
Kultur Dokumente
C is a general-purpose,
Block structured,
structured
Procedural,
Procedural
Computer programming language
Developed in 1972
by Dennis Ritchie
at the Bell Telephone Laboratories for use with the Unix
Operating System.
extension to C.
Uses of C
Operating System
Language Compilers
Assemblers
Text Editors
Modern Programs
Data Bases
Language Interpreters
¨˜”°º•Calypso•º°”˜¨ 4 12/07/21
Why C?
C is simple.
C is fast.
C offers better interaction with hardware.
hardware
ENGLISH C
Alphabets, Alphabets, digits, special
digits symbols
Words, Constants, variables, keywords
numbers
Sentences Statements or instructions
Paragraph Program
¨˜”°º•Calypso•º°”˜¨ 5 12/07/21
History of ANSI
ANSI=American national standard institute
INTEGER int
FLOAT float
CHARACTER char
void void
………………………………………………………………………………………………………………..
USER DEFINED DATA TYPES
TYPEDEF
ENUM
………………………………………………………………………………………………………………
16 bit short
32bit long
char 1byte
¨˜”°º•Calypso•º°”˜¨ 9 12/07/21
RULES / NOTE :
¨˜”°º•Calypso•º°”˜¨ 10 12/07/21
\t is used for text far from its actual position.
\b a backspace
\r a carriage return (without a line feed)
\‘ a single quote (e.g. in a character constant)
\" a double quote (e.g. in a string constant)
\\ a single backslash
…………………………………………………….
we don’t write in program r2
we write r*r
………………………………………………………
we use 3.14 in the PLACE of pie
……………………………………………………..
Computer is always read right to left.
…………………………………………………….
C is case sensitive
…………………………………………………….
¨˜”°º•Calypso•º°”˜¨ 11 12/07/21
Rules:
By clrscr( );
we can clear the screen,
it can used after data type declaration.
we use clrscr(); after the data type declaration and before
the printf( ).
…………………………………………………………
Full Forms
.h = Extension
¨˜”°º•Calypso•º°”˜¨ 14 12/07/21
Use of some key in the C - language
¨˜”°º•Calypso•º°”˜¨ 16 12/07/21
Flow Chart
Each symbol except (decision box) used in the flow chart should have
one entry point and one exit point.
Input /output
/read /write
Processing
Condition
connector
Start
Read a,b
Sum=a+b
Print sum
Stop
¨˜”°º•Calypso•º°”˜¨ 19 12/07/21
Algorithm
¨˜”°º•Calypso•º°”˜¨ 20 12/07/21
Characteristics of Algorithm
¨˜”°º•Calypso•º°”˜¨ 21 12/07/21
Algorithm: To find the area of rectangle
Step1: Read Length L and breadth b
Step2: Calculate area a = L * b
Step3: Display area
Step4: Stop
…………………………………………………………
TO FIND WHETHER THE GIVEN NO IS ODD OR EVEN
¨˜”°º•Calypso•º°”˜¨ 22 12/07/21
ERRORS
There are types of errors
Syntax Error
Logical Error
Run time Error
Syntax error
when rules or syntax of programming language are not followed
Logical error
error in planning the programming logic.
¨˜”°º•Calypso•º°”˜¨ 23 12/07/21
Software
software is a set of instructions that directs the computer to process information ,these
instructions are called programs.
without software computer can not work.
Types of software=
System software
Application software
System Software=
the system software contains those programs that control and support the computer system
and its data processing applications
it includes=
the operating system
the language translators
Operating System
operating system is a organized collection of integrated set of specialized programs that
controls the overall operations of a computer.
it helps the computer to supervise and manage its resources.
operating system calls the application program whenever needed.
translate the special service programs and manages data needed to produced the output as
desired by the users.
¨˜”°º•Calypso•º°”˜¨ 24 12/07/21
Application Software
Application software is a set of program designed for a specific uses
or application such as word processing ,graphics ,or spreadsheet
analysis.
The operating system acts as a communication link between the
hardware and the application program.
It is responsible for loading the application software into memory and
then staring the program.
When we have finished using application software we return to the
operating system.
¨˜”°º•Calypso•º°”˜¨ 25 12/07/21
PROGRAMMING LANGUAGE
A language is a system of communication.
A PROGRAMMING LANGUAGE consists of all symbols
,characters and usage rules that permit people to communicate with
computers
A program is a set of logically related instructions that are arranged
in a sequence that guides the computer to solve a problem.
The process of writing a program is called programming.
¨˜”°º•Calypso•º°”˜¨ 26 12/07/21
Machine Language
this is a sequence of instructions written in the form of
binary numbers consisting of 1's and 0's to which is the
computer responds directly.
A machine language has 2parts =
the first part is the command or an operation that tells
the computer what functions are to be performed.
the second part of the instruction is the operand that tells
the computer where to find or store the data on which the
desired operation is to be performed.
¨˜”°º•Calypso•º°”˜¨ 28 12/07/21
High Level Language
Readability
Portability
Easy Debugging
Easy Software Development
¨˜”°º•Calypso•º°”˜¨ 29 12/07/21
FIRMWARE
How does your computer know what to do when u turn it on ?
¨˜”°º•Calypso•º°”˜¨
the instructions stored in ROM are
30 not lost. 12/07/21
Translator
These are system software and program's that are used to convert
assembly or high level language into the Machine Code.
These are also called Language Processors.
Source Program Translator Object Program
TYPES =
Assembler
Compiler
Interpreter
¨˜”°º•Calypso•º°”˜¨ 31 12/07/21
Interpreter
simple and easy to write.
does not require much memory space to store itself
translate the program line by line into machine language.
check for the syntax errors line by line and execute each line or
statement immediately when statement become error free.
Testing
¨˜”°º•Calypso•º°”˜¨ 34 12/07/21
Debugging
¨˜”°º•Calypso•º°”˜¨ 35 12/07/21
Program Development Life Cycle
¨˜”°º•Calypso•º°”˜¨ 36 12/07/21
Documentation=
Uses of Documentation=
easier maintenance
avoid duplication
¨˜”°º•Calypso•º°”˜¨ 37 12/07/21
CHARACTER SET
C character set includes the
LETTERS=
UPPER CASE (A-Z)
LOWER CASE (a-z)
digits (0 - 9)
special character
White spaces=
BLANK SPACES
HORIZONTAL TAB
NEW LINE
FORM FEED
¨˜”°º•Calypso•º°”˜¨ 38 12/07/21
alphanumeric ,digits, and special symbol
Escape Sequence Character in C
bell \a
back space \b
horizontal tab \t
vertical tab \v
form feed \f
carrier return \r
back slash \\
null \0
question mark \?
¨˜”°º•Calypso•º°”˜¨ 39 12/07/21
C TOKENS
KEYWORD (EX. FLOAT ,WHILE)
( RESERVED WORD )
CONSTANTS (15.5,100)
STRINGS ("ABC","YEAR")
SPECIAL SYMBOL ([ ],{ })
OPERATORS ( + - * , )
IDENTIFIER /
¨˜”°º•Calypso•º°”˜¨ 40 12/07/21
VARIABLE NAME
CONSTANTS IN C=
Constant=quantity that does not change
¨˜”°º•Calypso•º°”˜¨ 41 12/07/21
Secondary Constant
Arrays
Pointer
Structure
Enum
Union
==============================
Integer Constant=
¨˜”°º•Calypso•º°”˜¨
must not contain white spaces.
spaces 44 12/07/21
C keyword and Reserve Word=
The words whose meaning has already been explained to the c compiler are
known as keyword the keywords can not be use as variable names.
ARITHMATIC OPERATOR
RELATIONAL OPERATOR
LOGICAL OPERATOR
ASSIGNMENT
INCREMENT (++)
DECREMENT (--)
CONDITIONAL (IF,ELSE)
BITWISE
COMMA ( ,)
SIZEOF( ) C COMPILE TIME
POINTER OPERATOR (*.&)
¨˜”°º•Calypso•º°”˜¨ 46 12/07/21
COMMA OPERATOR
Sum=(x=20,y=30,x+y)
Expressions are evaluated left to right and the value of rightmost
expressions is the value of the combined expression.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Used to determine the length of array and structure when their sizes are not known
to the programmer
Example:
If (first>second)
Max=first;
Else
Max=second;
The above statement can be written as
Max=(first>second) first: second;
¨˜”°º•Calypso•º°”˜¨ 48 12/07/21
The ? : operator
C language has a special operator, useful for making two way
decisions .
This operator is a combinational of ? And : takes three
operands.
This operator is popularly known as conditional operator or
ternary operator
The general form of conditional operator is as follows:
Conditional expression ?<expression1>:<expression2>
The conditional expression is evaluated first.
If the result is true, expression 1 is evaluated and returned as
the value of the conditional expression.
Otherwise expression 2 is evaluated and its value is returned .
In general conditional operator is used as substitute for simple
if…else Statement
¨˜”°º•Calypso•º°”˜¨ 49 12/07/21
Consider the following code:
int a=10;
Int b=20;
Int c;
If (a>b)
c=a;
else
c=b;
This code segment can be written as follows using
ternary operator
C=(a>b) ? a: b
¨˜”°º•Calypso•º°”˜¨ 50 12/07/21
Unary Operator
¨˜”°º•Calypso•º°”˜¨ 51 12/07/21
Arithmetic Operator
Operator meaning
Addition
+
Subtraction
-
Multiplication
*
Division
/
Module division
%
¨˜”°º•Calypso•º°”˜¨ 52 12/07/21
Relational Operator
OPERATOR MEANING
¨˜”°º•Calypso•º°”˜¨
!= 53
Not equal to 12/07/21
Logical Operator
Operator Meaning
&& AND
|| OR
! NOT
¨˜”°º•Calypso•º°”˜¨ 54 12/07/21
Assignment Operators
The assignment operator = assigns a value to a variable.
For example,
x = 1 sets x to 1,
and a = b sets a to whatever b's value is.
We've called the = sign the ``assignment operator'' and
referred to ``assignment expressions'' because, in fact, = is
an operator just like + or -.
C does not have ``assignment statements''; instead, an
assignment like a = b is an expression and can be used
wherever any expression can appear.
¨˜”°º•Calypso•º°”˜¨ 55 12/07/21
Since it's an expression, the assignment a = b has a value,
namely, the same value that's assigned to a. This value can then
be used in a larger expression;
for example, we might write
c = a = b which is equivalent to c = (a = b) and assigns b's
value to both a and c.
(The assignment operator, therefore, groups from right to left.).
¨˜”°º•Calypso•º°”˜¨ 56 12/07/21
BITWISE OPERATOR
OPERATOR MEANING
BITWISE AND
&
BITWISE OR
|
BITWISE EXCLUSIVE
^ OR
SHIFT LEFT
<<
SHIFT RIGHT
¨˜”°º•Calypso•º°”˜¨
>> 57 12/07/21
INCREMENT & DECREMENT OPERATOR
-- subtract 1
+ + i or I + +
- - i or I - -
----------------------------------------------------------------------------------------------------------
++i
I=I+1
I+=1 are equivalent
--------------------------------------------------------------------------------------------------------
-- i
I=I-1
¨˜”°º•Calypso•º°”˜¨
I -=1 are equivalent 58 12/07/21
---------------------------------------------------------------------------------------------------------
Control Structure in C
Conditional statement
If-else
Else-if
switch case
UNCONDITIONAL STATEMENT
While STATEMENT
Do while
for STATEMENT
jump
continue
break
goto
¨˜”°º•Calypso•º°”˜¨ 59 12/07/21
if -else
¨˜”°º•Calypso•º°”˜¨ 60 12/07/21
While loop
The while loop continues to loop until the conditional expression
becomes false. The condition is tested upon entering the loop.
Loops generally consist of one or more control expressions which
control the execution of the loop, and the body, which is the statement
or set of statements
The most basic loop in C is the while loop. A while loop has one
control expression, and executes as long as that expression is true.
The general syntax of a while loop is
while( expression ) statement A while loop starts out like an if
statement: if the condition expressed by the expression is true, the
statement is executed.
However, after executing the statement, the condition is tested again,
and if it's still true, the statement is executed again. (As long as the
condition remains true, the body of the loop is executed over and over
again. (If the condition is false right at the start, the body of the loop is
not executed at all.)
¨˜”°º•Calypso•º°”˜¨ 61 12/07/21
do.. while STATEMENT
do while is a exit control looping structure.
that is loop body will be executed first before evaluating loop control statement.
do
{
body of the loop;
.............
.............
}
While (test condition)
statement x;
¨˜”°º•Calypso•º°”˜¨ 62 12/07/21
do while
the loop get terminated once the test condition returns false
and the program control is passed to the statement that is next to the
loop control.
¨˜”°º•Calypso•º°”˜¨ 63 12/07/21
for statement
the for statement is the most popular and more concise loop control
structure supported by almost all the programming languages.
for is an entry control looping structure.
for is quite efficient looping structure when compared while or do while
because it takes cares of initialization of loop control variable evaluating
loop control statement,
increasing /decreasing the value of loop control variable.
the execution of the loop control variable is done first ,
using assignment statement such as i=1, or count =10 etc,
here i and count are referred as loop control variables,
¨˜”°º•Calypso•º°”˜¨ 64 12/07/21
the value of the loop control variable is tested using test
condition.
if the test condition n is true the body of the loop will be get
executed otherwise the loop will be get terminated and the
execution follows to the next statement that immediately
follows the loop.
¨˜”°º•Calypso•º°”˜¨ 65 12/07/21
when the loop body completes the execution the control is
passed back to the for statement
¨˜”°º•Calypso•º°”˜¨ 66 12/07/21
C Basic Programs
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("my name is MOHIT SHARMA \n3 k 21");
getch();
}
¨˜”°º•Calypso•º°”˜¨ 67 12/07/21
// (print positive –negative )
#include<stdio.h>
#include<conio.h>
void main( )
{
int n;
clrscr();
printf("enter n");
scanf("%d",&n);
if(n>0)
{printf("positive value");
}
else
{
printf("negative value");
}
getch();
}
¨˜”°º•Calypso•º°”˜¨ 68 12/07/21
// (voting program)
#include<stdio.h>
#include<conio.h>
void main()
{
int age;
clrscr();
printf("enter age");
scanf("%d",&age);
if(age>18)
else
{
printf(“ u r child ");
}
getch();
¨˜”°º•Calypso•º°”˜¨ 69 12/07/21
}
// A AND B WHICH IS MAX
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("enter a,b");
scanf("%d%d",&a,&b);
if(a>b)
{printf("a is max");
}
else
{
printf("b is max");
}
getch();
¨˜”°º•Calypso•º°”˜¨ 70 12/07/21
}
¨˜”°º•Calypso•º°”˜¨ 71 12/07/21
FEATUES OF POINTER
4. pointers use for manipulating dynamic data structure such as link list, queue,
stack, graph.
When 2 pointer point the same array one pointer variable can be subtracted from the
another variable.
¨˜”°º•Calypso•º°”˜¨ 73 12/07/21
“String Handling Function
in C"
strlen( ) calculates length of a string
strcpy( ) copy the contents of one string into another
strcmp( ) Used to compare to string
strlwr( ) Convert all characters in the given string
from upper case to lower case
strrev( ) Rearrange all character in the given string
in reverse order
Strcat( ) Used to add two given strings
Strupr( ) Convert all characters in the given string
¨˜”°º•Calypso•º°”˜¨ from lower case to upper case
74 12/07/21
Header file =
The c standard library contains files containing the standard
functions that ur program may use these files are known as
header files
<ctype.h> Character class test
¨˜”°º•Calypso•º°”˜¨ 76 12/07/21
Modular Programming=
¨˜”°º•Calypso•º°”˜¨
All module design a single entry 77and single exit. 12/07/21
Executing a c program
Creating the program
Compiling the program
Linking the program
Executing the program
DOCUMENTATION SECTION
LINK SECTION
DEFINITION SECTION
GLOBAL DECLARATION SECTION
MAIN FUNCTION SECTION
SUB PROGRAM SECTION78
¨˜”°º•Calypso•º°”˜¨ 12/07/21
Documentation section
consist of a set of comment lines giving the name of the program
the author or programmer and other details
Link section
provides instructions to the compiler to link functions from the system
library
Definition section
defines all symbolic constants.
Global declaration
global variables and user define function
int marks[100] ;
¨˜”°º•Calypso•º°”˜¨ 82 12/07/21
Declaring an Array
like any other variables arrays must be declared before they are used
for ex.
int arr[5];
now we have created an array that can store 5 integer values.
¨˜”°º•Calypso•º°”˜¨ 83 12/07/21
Memory Representation of Array
for ex.
int arr[5];
now we have created an array that can store 5 integer values.
all the elements of the array gets stored in consecutive memory locations.
in the above ex. we have declared an array that can stored 5 integer values
suppose the first element of the array is stored in 80th address location then the
second element gets stored in 82th ,
third in 84th ,
fourth in 86th and fifth in 88th address location
(remember each integer occupies 2bytes of storage in memory ,that is why address
locations are 80,82,84,86,88)
¨˜”°º•Calypso•º°”˜¨ 84 12/07/21
the above statement int arr [5] creates an array in the following manner in
computer memory
Size of an array:
U can find the size of an array ,by performing following
computation.
No of elements in an array *size of an array
Hence the size of the array int arr [5] would be 5 * sizeof (int)
That is 5*2=10 bytes (size of an int type on a 16bit machine is 2
bytes.)
¨˜”°º•Calypso•º°”˜¨ 85 12/07/21
Initialize an array
We can initialize the element of array either at the time of declaration or any where else in the
program .
Some of the general forms of the initializing an array are as follows
Initializing an array elements at the time of declaration
Int arr[5]={42, 13 ,87 ,76 ,54};
¨˜”°º•Calypso•º°”˜¨ 86 12/07/21
Code for initializing elements of array by accepting values from
keyboard
Int arr[5];
Int i;
For (i=0; i<5; i++)
{
Scanf (“ %d ”, & arr [i] );
}
¨˜”°º•Calypso•º°”˜¨ 87 12/07/21
Array in memory after initialization
42 13 87 76 54
Addresses of an individual
element in an array
¨˜”°º•Calypso•º°”˜¨ 88 12/07/21
Referring to the elements of an array
The main thing after declaring and initializing an array is how to
access the individual element of an array.
If u observe, while initializing elements of an array we have used
arr[0],arr[1]…. and so on.
From that we got a little bit of idea on how to refer to individual
element of an array.
42 13 87 76 54
¨˜”°º•Calypso•º°”˜¨ 90 12/07/21
Storage class in C
Automatic storage class, auto
local variable known to only to the function in
which it is declared .default is auto.
file.
User defined type declaration
C support a feature known as type definition” that allows
users to define an identifier that would represent an
existing data type.
The user define data type identifier can later be used to
declare variables.
It takes a general form:
typedef type identifier;
Where type refers to an existing data type and “identifier
“ refers to the “new” name given to the data type.
The existing data type may belongs to any class of type,
including the user defined ones.
Remember that the new type is new only in name, but
not the data type .
typedef cannot create a new type.
¨˜”°º•Calypso•º°”˜¨ 92 12/07/21
Some examples of type definition are:
Units batch1,batch2;
marks name1[50],name2[50] ;
Batch1 and batch2 are declared as int variable and name[50] and
name2[50] are declared as 50 element floating point array variable.
The main advantage of typedef is that we can create meaningful data
type names for increasing readability of the program.
Another user defined data type is enumerated data type provided by
ANSI standard .
¨˜”°º•Calypso•º°”˜¨
It is defined as follows. 93 12/07/21
FUNCTION
¨˜”°º•Calypso•º°”˜¨ 94 12/07/21
User Define Function
function definition=
formal parameter
actual parameter
function name
calling a function
¨˜”°º•Calypso•º°”˜¨ 97 12/07/21
prototype of a function (function declaration)
call by value
call by reference
primitive function
math.h
•abs()
•log()
sqr()
•exp()
cos()
sin()
¨˜”°º•Calypso•º°”˜¨ 99 12/07/21
Some points Regarding to the Recursion
The length of the source program can be reduced by using functions at appropriate
places.
This factor is particularly important when functions are having limited memory.
¨˜”°º•Calypso•º°”˜¨
A function once written ,compiled and packaged
102 into a library can be reused in many
12/07/21
other program without rewriting the code.
C functions can be classified into two categories :
Library functions
User defined functions
The basic difference between the two is =
Library are prewritten, compiled packaged into Header files and are
made as a part of c standard library.
The functions like printf (), scanf () etc. are a part of C Standard
Library,
Where as an user defined functions needs to be written by the
programmer according to the requirements of the application he is
developing.
Function prototype must appear before the statement that call the
respective functions and are usually placed at the beginning of the
program
In the above program the line int square (int) ; is the function
prototype.
¨˜”°º•Calypso•º°”˜¨ 105 12/07/21
A part of the function prototype is the function signature
A function signature is the consist of the name of the function and
order and type of the arguments
In the above ex..=
int square (int) ; //function signature
Function Header
return type function name ( Argument list )
argument declaration ;
( or )
(or )
¨˜”°º•Calypso•º°”˜¨ 107 12/07/21
int add (int x, int y )
Function Body
function body contains the actual code that implements the functionality
of the function.
in general function body contains declaration of local variables and
statement and generally looks in the following form:
{
local variable declarations;
function statements;
……………
……........
return ( expression) ;
}
Formal Arguments
Formal Arguments are valid variables that are used in Function
Header of the function definition in order to store the values of the
actual arguments.
Formal Arguments are must be surrounded by parenthesis.
must not be terminated by using a semicolon.
¨˜”°º•Calypso•º°”˜¨ 110 12/07/21
Actual Arguments
Actual Arguments are the values that are passed to a
Function during a Function Call
An actual argument can be either a variable or constant or
valid expression .
one more thing is to be remember is the type and order of
the actual arguments must match the formal arguments.
or
return (expression) ;
Paramerters
information flow to the function
Local variables
variables and witin the function (private to the function)created
when function is called, ”destroyed”when functions returns.
Function Body
contains the software that implements the function
Return Staement
specifies the value that is returned to the caller,returns flow of
execution to the caller
¨˜”°º•Calypso•º°”˜¨ 118 12/07/21
¨˜”°º•Calypso•º°”˜¨ 119 12/07/21
Without Return Value without Argument
Rule :
When the value is not return then it is essential to write void
in definition.
When the value is return then we can not use void in the
definition part.
when the value is return then we write
int function name;
then we also write
int definition;
and
then we also write
int declaration;
¨˜”°º•Calypso•º°”˜¨ 120 12/07/21
Calling a function:
a function can be called by simplifying using the function
name in an statement .
example:
void main()
{
int p;
p=mul(10 , 4);
printf (“ %d ”,p);
}
when the compiler encounters a function call, the control is
transferred to the function mul (x , y).
this function is then executed line by line as described and a
value is returned when a return statement is encountered
.this value is assigned to p.
¨˜”°º•Calypso•º°”˜¨ 121 12/07/21
No arguments and No return values
when a function has no argument ,it does not receive any data from the
calling function.
similarly when n it does not return a value, the calling function does
not receive any data from the called function.
void main()
{
void sum( ); //declaration
sum(); //calling the function
sum(); //calling the function
sum(); //calling the function
getch();
}
void sum() //definition
{
int x,y,z;
printf( “enter the value of x , y ”);
scanf (“%d %d”,&x,&y);
z=x+y;
printf (“ the z is % d ”,z”);
} ¨˜”°º•Calypso•º°”˜¨ 123 12/07/21
# header file //With return value Without argument
void main()
{
int a,b; //data type declare
int sum(); // function declaration
a= sum( ); //calling the function
b=sum( ); //calling the function
printf(“%d”,a);
printf(“%d”,b);
getch();
}
int sum() // function definition
{
int x,y,z;
printf( “enter the value of x , y ”);
scanf (“%d %d”,&x,&y);
z=x+y;
return(z);
}
LOCAL
(ONLY FOR SUB PROGRAM)
GLOBAL
(FOR WHOLE PROGRAM)
FOR EX.
main()
{
subprogram-->function
int p
......
return 0;
} ¨˜”°º•Calypso•º°”˜¨ 127 12/07/21
Unformatted Console I/O
main( )
int main()
void main()
main(void)
Return type
Function Name
Semicolon
};
struct student
{
char name[20];
int age;
float height,weight;
};
}
getch();
}¨˜”°º•Calypso•º°”˜¨ 141 12/07/21
structures and pointers
#include<stdio.h>
strucrt student
{ char name[20];
int age;
float height,weight;
};
main()
{
struct student s,*ptr=&s;
printf(“enter name\n”);
scanf(“%s”,&ptr->age);
printf(“enter age \n”);
scanf(“%d”,&ptr->age);
printf(“enter height and weight of the student \n”);
scanf(“%f%f”,&ptr->height,&ptr->weight);
printf(“name\t%s\n”ptr->name);
printf(“age\t%d\n”,ptr->age);
printf(“height\t%5.5f \t weight \t %5.2f\n”,ptr->height,ptr->weight)”
getch();
} ¨˜”°º•Calypso•º°”˜¨ 142 12/07/21
¨˜”°º•Calypso•º°”˜¨ 143 12/07/21
¨˜”°º•Calypso•º°”˜¨ 144 12/07/21
¨˜”°º•Calypso•º°”˜¨ 145 12/07/21
¨˜”°º•Calypso•º°”˜¨ 146 12/07/21
¨˜”°º•Calypso•º°”˜¨ 147 12/07/21
¨˜”°º•Calypso•º°”˜¨ 148 12/07/21
¨˜”°º•Calypso•º°”˜¨ 149 12/07/21
File System
File function in C =
fopen
fclose
fscanf
fprintf
putc
putw
getc
getw
wind
ftail
¨˜”°º•Calypso•º°”˜¨
fsick 150 12/07/21
File Operation
Creation
updation
Insertion
deletion
modification
Maintenance
retrieval
……………………………………
give 2 ex. of OOP?
c++, java, c sharp
……………………………………..
bell \a
back space \b
horizontal tap \t
vertical tab \v
form feed \f
carrier return \r
back slash \\
null \0
question mark \?
…………………………………………………..
what are constants?
¨˜”°º•Calypso•º°”˜¨ 154 12/07/21