CSE Exp-1
CSE Exp-1
Experiment No. 1
INTRODUCTIONTION TO C LANGUAGE
PRELAB WORK:
Read this laboratory manual carefully before
laboratory class, so that you know what is required.
Try to follow the lecture notes of CSE 181.
DONT copy others blindly!!!
Submit your lab report before the roll call.
coming
to
the
OBJECTIVE:
a) To get familiar with C Language.
b) To write down C program to print messages on output screen.
FOR OBJECTIVE-(a)
Program Code 1
/* Writing a Message */
#include<stdio.h>
main( )
{
printf(Hello World);
}
After finishing the code click on Compile menu, then click on Compile.
If any is shown correct it.
Repeat above two step until Compile shows Success.
Then click on Run menu, then click on Run.
FOR OBJECTIVE-(b)
For Program Code 1, the output screen will be shown for few microseconds and will also
be shown a warning. To avoid this problems the following Program Code should be
followed:
Program Code 2
/* Writing a Message */
#include<stdio.h>
#include<conio.h>
void main( )
{
printf(Hello World);
getch( );
}
After execution Program Code 2, the output will remain in output screen. Therefore,
when we again execute the program, the output of previous execution will also be shown.
To avoid this problem, we have to follow the following program code.
Program Code 3
/* Writing a Message */
#include<stdio.h>
#include<conio.h>
void main( )
{
clrscr( );
printf(Hello World);
Prepared by Dr. Md. Azad Hossain & Piyas Chowdhury
Supervised by Dr. Quazi Delwar Hossain
getch( );
}
To write down messages in different lines we have to follow the following program code.
Program Code 4
/* Writing a Message */
#include<stdio.h>
#include<conio.h>
void main( )
{
clrscr( );
printf(This is first statement.\n);
printf(This is second statement.);
getch( );
}
HOME TASK:
1. Write a C program to show your name, ID no., department and university on output
screen as following format:
Name:
ID no.:
Department:
University: