WINSEM2023-24_BCSE102P_LO_VL2023240504541_2024-01-04_Reference-Material-I

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

BCSE 102 Structured and Object-

Oriented Programming (Lab)

Dr. Biji C. L
Associate professor
Department of Analytics
School of Computer Science and Engineering (SCOPE)
Vellore Institute of Technology (VIT), Vellore
Email: biji.cl@vit.ac.in
Contact Information
Office Cabin: PRP 213 H
Email: biji.cl@vit.ac.in
Mobile Number: 9446171877

Open Hours:
Wednesday : 11 am -12:30 noon
Outcome
• To understand use Simple C Commands
• To understand and familiarize the data types
• To write simple C codes to perform arithmetic operations
Installation: Code Blocks
Installation: Code Blocks
Installation: Code Blocks
Project=One Program
Console Application
C Console
Project Title
Creation of Project
Compiler
Project
Select main()
Hello World
Build and Run
Header Files
Statement
Structure of C-Layout
Basic Commands
Basic Commands
Data Type Formatting
Exercise-1
• Write a C program to demonstrate input and output of all basic
and derived types. How to use scanf() and printf() function
perform input and output on primitive types in C
programming.
Example

Input
Enter a character: C
Enter a signed short value: -32768
Output
You entered character: 'C’
You entered signed short: -32768
Sample Code 1 : Getting Character and
printing it
Sample Code 2 : Getting Character and
printing it
Data Type : Character
Data Type : Int Range

sizeof (short) ≤ sizeof (int) ≤ sizeof (long) ≤ sizeof (long long)


Typical Integer Sizes and Values for Signed Integers
Data Type : Float Range

sizeof (float) ≤ sizeof (double) ≤ sizeof (long double)


Sample Code 3 : Getting Integer and
printing it
Try using Code blocks
Exercise 2
Write a C program to input two numbers from user and calculate
their sum. C program to add two numbers and display their sum
as output. How to add two numbers in C programming.
Example

Input
Input first number: 20
Input second number: 10
Output
Sum = 30
Sample Code

You might also like