Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
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