Programming Practical
Programming Practical
Programming Practical
PROGRAMMING
METHODOLOGIES -
LABORATORY
Lecture #0
The kick start session
Course details
LTP – 0 0 2
[Two Practical/week]
Credits: 1
Text books:
C:THE COMPLETE REFERENCE BY SCHILDT AND
HERBERT, MC GRAW HILL
Designingprograms in appropriate
languages and
Implementation on a suitable
platform
C Programming Language
C is a general-purpose, procedural, high-level
programming language used in the
development of computer software and
applications, system programming, games,
web development, and more.
New Lines
The newline character ( \n ) is called an escape sequence, and
it forces the cursor to change its position to the beginning of the
next line on the screen.
Printing of Messages with
tab space
Horizontal tab (\t)
We use it to shift the cursor to a couple of spaces to the right in the
same line.
printf() and scanf() in C
The printf() and scanf() functions are used for input and
output in C language. Both functions are inbuilt library
functions, defined in stdio.h (header file).
printf() function
The printf() function is used for output. It
prints the given statement to the console.
The syntax of printf() function is given below:
printf("format string",argument_list);
The format string can be %d (integer), %c (character),
%s (string), %f (float) etc.
scanf() function
The scanf() function is used for input.
It reads the input data from the console.
Syntax
scanf("format string",argument_list);
Example
scanf("%d",&number)