Professional Documents
Culture Documents
Section - 9/C: Tutorial & Laboratory
Section - 9/C: Tutorial & Laboratory
Section - 9/C: Tutorial & Laboratory
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 1
Programming & Data Structure: CS11001/19001
Section - 9/C
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 2
Download
http://www.facweb.iitkgp.ernet.in/∼goutam
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 3
Submission of an Assignment
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 4
Sessional Evaluation
• Correctness of program!
• Regularity of work.
• Programming style.
• Program debugging and testing (by
the student).
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 5
Note
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 6
Program Header
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 7
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 8
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 9
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 10
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 11
Submission File
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 12
Submission by ftp
$ ftp 10.3.19.55
Connected to 10.3.19.55 (10.3.19.55).
220 pclabII102 FTP server (Version wu-2.6.2-5)
ready.
Name (10.3.19.55:.....): pds09
Password: *******
230 User pds07 logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
> cd assignment04
250 CWD command successful.
ftp> put C0604.prn
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 13
Submission by ftp
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 14
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 15
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 16
/******************************************
* Section : C/9 *
* M/c No. : 06, Roll No. : 20MB3007, *
* Name : Arya Bhatta, *
* Assignment No. : 04, *
* Description : Program to calculate a *
* given function. *
******************************************/
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 17
int main() {
float x, fx, temp ;
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 19
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 20
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 21
$ cp C0604.c C0604.prn
$ cat C0604.out >> C0604.prn
$ cat C0604.prn | less
& %
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 22
/******************************************
* Section : D/2 *
.............................
int main() {
float x, fx, temp ;
.............................
printf("\nf(%f) = %f\n", x, fx) ;
}
Enter the value of x :
f(-1.000000) = 10.000000
& %
.............................
' $
PDS Tut. & Lab.: II (CS 11001/19001): Section 9 Dept. of CS&Engg., IIT Kharagpur 23
Assignment Programs