Professional Documents
Culture Documents
126
INTRODUCTION TO C PROGRAMMING AND
FORMATTED I/O
(EXPERIMENT 1)
LECTURER :
GROUP MEMBERS :
1.FARDIANA EDRINA BINTI MOHAMMAD SHAARI
2.FATIN ATIKAH BINTI MD YA’ACOB
3.ARESSA SOFEA BINTI SHAHARUDIN
OBJECTIVES
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello world!\n");
return 0;
}
DISCUSSION PART A (WELCOME TO C)
Experiment 1 Part A (welcome to C) are the introduction to the
programming. There are many programming software but
CodeBlocks are the main software of doing this experiment.
CodeBlocks is an open source software that gained from Integrated
Development Environment (IDE). Function of the software are
allowing the users to debug their programme by having access to
their function. Basically this software provides many type of
programme such as C, C++, and others. C programme helps you to
understand the internal architecture of a computer, how computer
stores and retrieves information. In the experiment 1, the uses of C
programme is important. From the procedure shows on how to
create a new project and save it into a folder by using the
CodeBlocks. The first task is “Hello world!” is written in the main c by
clicking the button of sources. To check there is an errors or not, the
build and run button were used to comfirm there is no errors in the
workspace. It is more easier to identify the errors of coding. Starting
with the common pre-processor directives #include
<studio.h> and #include <stdlib.h> telling the copiler
to include input or output library. Then the int main() is defining
a main function. Printf(“Hello world!\n”); the main
function calling library output function to print the text enclose by
symbol double quote. In the below of this word written return 0;
impliying normal termination of the program. The open and close
braces {} enclose the main function of the program. In this
experiment part A also had major implementation issue for a
beginner student. For example the carelessness about the symbols or
typos while doing the experiment. In which of the typos and
carelessness bringing the bugs and error to the programme then
allows the programme not displaying the written task. It is important
to keep full attention and focusing while doing the experiment.
#include <stdio.h>
#include <stdlib.h>
int main()
int var1; // declare variable var1 type int
var1 = 5; // store value of 5 into variable var1
char var2;
var2 = 'a';
float var3;
var3 = 10.54;
double var4;
var4 =205.7256;
printf("The value of variable var1 is %d\n", var1);
printf("The value of variable var2 is %c\n", var2);
printf("The value of variable var3 is %f\n", var3);
printf("The value of variable var1 is %1f\n", var4);
return 0;
}