SlideShare a Scribd company logo
CSC – 184
Programming C
Lab – 2 (week - 2)
Md. Mortuza Hossain
Assistant Lecturer, Department of CSE
IUBAT
8 October 2017 1CSC-184
32 Keywords in C
auto double int struct
break else long switch
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while
8 October 2017 CSC-184 2
Problem 1: Print two Integer number
#include<stdio.h>
int main()
{
int a,b;
a = 20;
b = 10;
printf("a = %d , b = %d",a,b);
return 0;
}
8 October 2017 CSC-184 3
Problem 2: Add two Number & Show output
#include<stdio.h>
int main()
{
int a,b,c;
a = 20;
b = 10;
c = a + b;
printf("Summation of a + b = %d n",c);
return 0;
}
 Try yourself : c = a-b , c = a*b , c = a/b
8 October 2017 CSC-184 4
Introduce scanf():
• To give input to a program from keyboard we
need to use scanf() function.
• It is a built-in function of C.
• The definition of scanf() function given in stdio.h
header file.
• So if you use scanf() function into your program,
you should #include<stdio.h> header file.
8 October 2017 CSC-184 5
Problem 3: Add two Number & Show output
#include<stdio.h>
int main()
{
int a,b,c;
printf("Enter two numbers: ");
scanf("%d %d",&a,&b);
c = a + b;
printf("n Summation of a + b = %d n",c);
return 0;
}
 Try yourself : c = a-b , c = a*b , c = a/b
8 October 2017 CSC-184 6

More Related Content

DOCX
Write a program to perform translation.
DOCX
Write a program to perform translation
PPTX
Space complexity
PDF
Bcsl 033 data and file structures lab s5-2
DOCX
Code for program to draw a circle using mid point circle algorithm in c
DOCX
Practical no 1
PDF
C mcq practice test 1
PDF
Write declarations for each of the following variables: a. amounts is a...
Write a program to perform translation.
Write a program to perform translation
Space complexity
Bcsl 033 data and file structures lab s5-2
Code for program to draw a circle using mid point circle algorithm in c
Practical no 1
C mcq practice test 1
Write declarations for each of the following variables: a. amounts is a...

What's hot (20)

PDF
C multiple choice questions and answers pdf
DOCX
C++ programming example
DOCX
Binary addition using class concept in c++
DOC
Ffffffffffff
PDF
Infix to Prefix (Conversion, Evaluation, Code)
PDF
Verilog VHDL code Parallel adder
PDF
C mcq practice test 2
PPTX
C++ training day01
DOCX
Practical no 3
PPTX
Benchmark it
PDF
1 c introduction
PDF
Programs that work in c and not in c
PDF
PPTX
PPTX
C++ questions
DOCX
Write a program that calculate the no of prime no,even and odd no.
DOCX
Pslb lab manual
DOCX
Array using recursion
DOCX
A.P.S.E PRACTICAL FILE, NIT KURUKSHETRA
C multiple choice questions and answers pdf
C++ programming example
Binary addition using class concept in c++
Ffffffffffff
Infix to Prefix (Conversion, Evaluation, Code)
Verilog VHDL code Parallel adder
C mcq practice test 2
C++ training day01
Practical no 3
Benchmark it
1 c introduction
Programs that work in c and not in c
C++ questions
Write a program that calculate the no of prime no,even and odd no.
Pslb lab manual
Array using recursion
A.P.S.E PRACTICAL FILE, NIT KURUKSHETRA
Ad

Similar to CSC – 184 Programming C (20)

PPTX
Najmul
PPTX
C Language Programming Introduction Lecture
DOC
C-programs
PPTX
Introduction to Basic C programming 02
PPTX
CSE-1204-Lab-02-Variables and Data Types.pptx
PDF
Subject:Programming in C - Lab Programmes
PPTX
Discussing Fundamentals of C
PPTX
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptx
PDF
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
DOCX
programs of c www.eakanchha.com
DOCX
PDF
First c program
PPTX
C for Engineers
DOCX
Fuzail_File_C.docx
PPTX
Introduction to C Unit 1
DOC
'C' language notes (a.p)
DOCX
Programming fundamentals
DOCX
Core programming in c
Najmul
C Language Programming Introduction Lecture
C-programs
Introduction to Basic C programming 02
CSE-1204-Lab-02-Variables and Data Types.pptx
Subject:Programming in C - Lab Programmes
Discussing Fundamentals of C
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptx
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
programs of c www.eakanchha.com
First c program
C for Engineers
Fuzail_File_C.docx
Introduction to C Unit 1
'C' language notes (a.p)
Programming fundamentals
Core programming in c
Ad

More from ABIR A HAPZU (6)

PDF
The necessary things used in surveying
PDF
ভাল পাথর চেনার উপাই - Identify good stone for Construction
PPTX
Civil Engineering Materiel's 2017
PPTX
Newton laws of motion summer 17
PDF
Industrial chemistry Cement & Soap
PPTX
The life of steve jobs power point presentation
The necessary things used in surveying
ভাল পাথর চেনার উপাই - Identify good stone for Construction
Civil Engineering Materiel's 2017
Newton laws of motion summer 17
Industrial chemistry Cement & Soap
The life of steve jobs power point presentation

Recently uploaded (20)

PDF
RMMM.pdf make it easy to upload and study
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Basic Mud Logging Guide for educational purpose
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Computing-Curriculum for Schools in Ghana
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Pharma ospi slides which help in ospi learning
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Institutional Correction lecture only . . .
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Classroom Observation Tools for Teachers
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
master seminar digital applications in india
PDF
Insiders guide to clinical Medicine.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Complications of Minimal Access Surgery at WLH
RMMM.pdf make it easy to upload and study
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Basic Mud Logging Guide for educational purpose
Sports Quiz easy sports quiz sports quiz
Computing-Curriculum for Schools in Ghana
Module 4: Burden of Disease Tutorial Slides S2 2025
Pharma ospi slides which help in ospi learning
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Institutional Correction lecture only . . .
Abdominal Access Techniques with Prof. Dr. R K Mishra
Final Presentation General Medicine 03-08-2024.pptx
Classroom Observation Tools for Teachers
human mycosis Human fungal infections are called human mycosis..pptx
master seminar digital applications in india
Insiders guide to clinical Medicine.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPH.pptx obstetrics and gynecology in nursing
Complications of Minimal Access Surgery at WLH

CSC – 184 Programming C

  • 1. CSC – 184 Programming C Lab – 2 (week - 2) Md. Mortuza Hossain Assistant Lecturer, Department of CSE IUBAT 8 October 2017 1CSC-184
  • 2. 32 Keywords in C auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while 8 October 2017 CSC-184 2
  • 3. Problem 1: Print two Integer number #include<stdio.h> int main() { int a,b; a = 20; b = 10; printf("a = %d , b = %d",a,b); return 0; } 8 October 2017 CSC-184 3
  • 4. Problem 2: Add two Number & Show output #include<stdio.h> int main() { int a,b,c; a = 20; b = 10; c = a + b; printf("Summation of a + b = %d n",c); return 0; }  Try yourself : c = a-b , c = a*b , c = a/b 8 October 2017 CSC-184 4
  • 5. Introduce scanf(): • To give input to a program from keyboard we need to use scanf() function. • It is a built-in function of C. • The definition of scanf() function given in stdio.h header file. • So if you use scanf() function into your program, you should #include<stdio.h> header file. 8 October 2017 CSC-184 5
  • 6. Problem 3: Add two Number & Show output #include<stdio.h> int main() { int a,b,c; printf("Enter two numbers: "); scanf("%d %d",&a,&b); c = a + b; printf("n Summation of a + b = %d n",c); return 0; }  Try yourself : c = a-b , c = a*b , c = a/b 8 October 2017 CSC-184 6