C PROGRAMMING LAB MANUAL

Similar documents
PROGRAMMING IN C AND C++:

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU 2013

Questions Bank. 14) State any four advantages of using flow-chart

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100

Aryan College. Fundamental of C Programming. Unit I: Q1. What will be the value of the following expression? (2017) A + 9

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR

M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

Subject: Computer Science

Kadi Sarva Vishwavidyalaya, Gandhinagar

UNIT I : OVERVIEW OF COMPUTERS AND C-PROGRAMMING

Multiple Choice Questions ( 1 mark)

(i) Describe in detail about the classification of computers with their features and limitations(10)

Syllabus of Diploma Engineering. Computer Engineering. Semester: II. Subject Name: Computer Programming. Subject Code: 09CE1104

Scheme G. Sample Test Paper-I. Course Name : Computer Engineering Group Course Code : CO/CD/CM/CW/IF Semester : Second Subject Tile : Programming in C

Question Bank (SPA SEM II)

Reg. No. : Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, JANUARY First Semester GE 6151 COMPUTER PROGRAMMING

LOOPS. 1- Write a program that prompts user to enter an integer N and determines and prints the sum of cubes from 5 to N (i.e. sum of 5 3 to N 3 ).

For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit

Programming for Problem Solving 105A L T P Credit Major Minor Total Time

KLiC C Programming. (KLiC Certificate in C Programming)

Downloaded from

Loops / Repetition Statements

Euclid s algorithm, 133

Suggestive List of C++ Programs

PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE

INDIAN SCHOOL MUSCAT COMPUTER SCIENCE(083) CLASS XI

Algorithms 4. Odd or even Algorithm 5. Greatest among three numbers Algorithm 6. Simple Calculator Algorithm

MA 511: Computer Programming Lecture 2: Partha Sarathi Mandal

Course Title: C Programming Full Marks: Course no: CSC110 Pass Marks: Nature of course: Theory + Lab Credit hours: 3

PESIT Bangalore South Campus Hosur Road (1km before Electronic City), Bengaluru Department of Basic Science and Humanities

UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA C ASSIGNMENTS

M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

r } ~ ~ ~.,-~_.-.,..--- ~.._ ~ -.- " ~.., ~ i-~--~-..., _-_... 4 _-~ _. '".~ j l.- ~ i...l...i- ~.JI

Computer Programming C++ (wg) CCOs

The Hyderabad Public School, Begumpet, Hyderabad, A.P

DR. A.P.J. ABDUL KALAM TECHNICAL UNIVERSITY LUCKNOW. Evaluation Scheme & Syllabus. For. B.Tech. First Year (Programming for Problem Solving)

P.E.S. INSTITUTE OF TECHNOLOGY BANGALORE SOUTH CAMPUS 1 ST INTERNAL ASSESMENT TEST (SCEME AND SOLUTIONS)

'C' Programming Language

Gujarat University M. Sc. Computer Science [S. F.] Semester-1 Syllabus Gujarat Arts & Science College, Ahmedabad.

Hrs Hrs Hrs Hrs Hrs Marks Marks Marks Marks Marks

COMPUTER PROGRAMMING LAB

Faculty of Engineering Computer Engineering Department Islamic University of Gaza C++ Programming Language Lab # 6 Functions

Main Program. C Programming Notes. #include <stdio.h> main() { printf( Hello ); } Comments: /* comment */ //comment. Dr. Karne Towson University

Laboratory 2: Programming Basics and Variables. Lecture notes: 1. A quick review of hello_comment.c 2. Some useful information

Lab Manual. Program Design and File Structures (P): IT-219

CpSc 1111 Lab 4 Formatting and Flow Control

VARIABLE, OPERATOR AND EXPRESSION [SET 1]

Contents. Preface. Introduction. Introduction to C Programming

Tribhuvan University Institute of Science and Technology 2065

Subject: Fundamental of Computer Programming 2068

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

Computers Programming Course 5. Iulian Năstac

MODULE 2: Branching and Looping

AHLCON PUBLIC SCHOOL, MAYUR VIHAR I, DELHI ASSIGNMENT CLASS XI Session Chapter 1: Computer Overview

Department of Computer Science & Engineering Indian Institute of Technology Kharagpur. Practice Sheet #05

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Basic Science and Humanities

BCA-105 C Language What is C? History of C

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and

Assignment: 1. (Unit-1 Flowchart and Algorithm)

Software Development & Education Center C Programming

(Following Paper ID and Roll No. to be filled by the student in the Answer Book)

CpSc 1111 Lab 5 Formatting and Flow Control

Code No: R Set No. 1

C- PROGRAMMING (3:0:0) Sub code : CS1C01/CS2C01 CIE : 50%Marks Hrs/week : 03 SEE : 50%Marks SEE Hrs : 03 Hours Max. Marks: 100 Course Outcomes:

Fundamental of Programming (C)

Programming Fundamentals (CS 302 ) Dr. Ihsan Ullah. Lecturer Department of Computer Science & IT University of Balochistan

IV Unit Second Part STRUCTURES

UNIT IV INTRODUCTION TO C

Sai Nath University. Assignment For MCA 1 st

Fundamentals of Programming

Lectures 5-6: Introduction to C

Course Outline Introduction to C-Programming

Flow Chart. The diagrammatic representation shows a solution to a given problem.

P.E.S. INSTITUTE OF TECHNOLOGY BANGALORE SOUTH CAMPUS DEPARTMENT OF SCIENCE AND HUMANITIES EVEN SEMESTER FEB 2017

Department of Computer Science & Engineering Indian Institute of Technology Kharagpur. Practice Sheet #07. Topic: Pointer in C Date:

PDS Lab (Assignment 1) Date: 31 st July, 2017 (2-6 pm)

Computer Science & Information Technology (CS) Rank under AIR 100. Examination Oriented Theory, Practice Set Key concepts, Analysis & Summary

CpSc 1011 Lab 4 Formatting and Flow Control Windchill Temps

Fundamentals of Programming. Lecture 11: C Characters and Strings

Programming and Data Structures

IECD Institute for Entrepreneurship and Career Development Bharathidasan University, Tiruchirappalli 23.

ET156 Introduction to C Programming

Department of Computer Science & Engineering Indian Institute of Technology Kharagpur. Practice Sheet #06

Programming and Data Structure

Advanced C Programming and Introduction to Data Structures


PROGRAMS. EXCELLENT ACADEMY OF ENGINEERING. Telephone: / NORMAL PROGRAM

CSCI 171 Chapter Outlines

Chapter 3 Problem Solving and the Computer

Lectures 5-6: Introduction to C

Functions. Lab 4. Introduction: A function : is a collection of statements that are grouped together to perform an operation.

Fundamentals of Computer Programming Using C

CpSc 1111 Lab 4 Part a Flow Control, Branching, and Formatting

DEPARTMENT OF MATHS, MJ COLLEGE

sends the formatted data to the standard output stream (stdout) int printf ( format_string, argument_1, argument_2,... ) ;

Flowchart, Types, and Values

COMPUTER APPLICATION

Module 7 Highlights. Mastered Reviewed. Sections ,

Advanced C Programming Topics

UNIT-I Input/ Output functions and other library functions

Transcription:

C PROGRAMMING LAB MANUAL For BEX/BCT/B.Sc.CSIT/BIM/BCA BY BABU RAM DAWADI RAM DATTA BHATTA

448/ From the Book: Capsules of C Programming Appendix - B C PROGRAMMING LAB SHEETS Dear Students, Welcome to C programming Lab. For the practical works of C programming, you have to complete at least eight to ten lab activities throughout the course. These lab sheets will guide you to prepare for programming and submission of lab reports. Further, it helps you to understand practically about the knowledge of programming. You can use this lab guide as the base reference during your lab. You have to submit lab report of previous lab into corresponding next lab during when your instructor shall take necessary VIVA for your each lab works. For your reference, how to write a complete lab report? is being prepared as sample report for LAB sheet #1 and LAB sheet #2 in this manual. For the rest of your labs, please follow the reporting style as provided. Your lab report to be submitted should include at least the following topics. 1. Cover page 2. Title 3. Objective(s) 4. Problem Analysis 5. Algorithm 6. Flowchart 7. Coding 8. Output (compilation, debugging & testing) 9. Discussion & Conclusion. On each lab, you have to submit the report as mentioned above however for additional lab exercises; you have to show the coding and output to your instructor. Note: The lab exercises shall not be completed in a single specific lab. Students are encouraged to complete the programming questions given in the exercise prior to come to the lab hour and do the lab for the given title/objectives.

C Programming Lab Sheets /449 (Sample Cover page, please use your own university/college name& department for your lab report submission) Tribhuvan University Institute of Engineering Central Campus, Pulchowk LAB Sheet #1 C Lab Report Submitted By: Name: RollNo: Submitted To: Department of Electronics and Computer Engineering Lab Date: Marks & Signature Submission Date:

450/ From the Book: Capsules of C Programming To be familiar with syntax and structure of C-programming. To learn problem solving techniques using C Write a Program to calculate and display the volume of a CUBE having its height (h=10cm), width (w=12cm) and depth (8cm). The problem is to calculate the volume of a CUBE having its inputs parameters identified as:height (integer type), width (integer type) and depth (integer type). The output of the program is to display the volume; hence the output parameter is identified as vol (integer type). During the processing or calculation phase, we don t need any extra parameters (variables) for this problem. The volume of the cube is the multiplication of its height, width and depth, hence the mathematical formula to calculate volume is: vol = height* width* depth. (vol = h*w*d) Input variables h(int) w(int) d(int) Processing variables/calculations vol = h*w*d Output variables vol (int) 1. Start 2. Define variables: h(int), w(int), d(int), vol(int) 3. Assign value to variables: h = 10, w=12, d=8 4. Calculate the volume as: vol = h*w*d 5. Display the volume (vol) 6. Stop Necessary header files/functions/macros stdio.h //Following code is written and compiled in :Blocks IDE #include<stdio.h> int main(void) { //start the program inth,w,d,vol; //variables declaration h=10;w=12;d=8; //assign value to variables vol=h*w*d; //calculation using mathematical formula printf("the Volume of the cube is: %d",vol); //display the volume return 0; //end the main program }

C Programming Lab Sheets /451 Output (Compilation, Debugging & Testing) The Volume of the cube is: 960 Discussion and Conclusion This is the first code written in C program. The program is focused on the calculation of volume of a cube for the given height, width and depth. From this lab, I understood the basic structure of C programming including the meaning of header files & steps of problem solving. Hence, volume of a cube is calculated and displayed. Lab exercises (please code yourself and show the output to instructor): 1. Write a program to display hello world in C. 2. Write a program to add two numbers (5&7) and display its sum. 3. Write a program to multiply two numbers (10&8) and display its product. 4. Write a program to calculate area of a circle having its radius (r=5). 5. Write a program to calculate area of an ellipse having its axes (minor=4cm, major=6cm). 6. Write a program to calculate simple interest for a given P=4000, T=2, R=5.5. (I = P*T*R/100)

452/ From the Book: Capsules of C Programming (Sample Cover page, please use your own university/college name & department for your lab report submission) Tribhuvan University Institute of Engineering Central Campus, Pulchowk LAB Sheet #2 C Lab Report Submitted By: Name: RollNo: Submitted To: Department of Electronics and Computer Engineering Lab Date: Marks & Signature Submission Date:

C Programming Lab Sheets /453 To be familiar with different data types, Operators and Expressions in C. Write a program to take input of name, rollno and marks obtained by a student in 5 subjects each have its 100 full marks and display the name, rollno with percentage score secured. Based on the problem, it is required to get the input of name, roll number and marks in 5 subjects of a student. The program should display the name; roll number and percentage of marks secured by that student as output. The input variables shall be: name, rollno, msub1, msub2, msub3, msub4, msub5. We need to calculate percentage of marks obtained. So the variable score holds the percentage to be displayed. Percentage of marks obtained = total marks on 5 subjects total full marks 100 Hence, msum = msub1 + msub2 + msub3 + msub4 + msub5; Score = msum 500 100 Input variables Processing Output variables Necessary header variables/calculations files/functions/macros Name (char type) msum (float) name (char type) stdio.h rollno (int) rollno (int) conio.h msub1, msub2, score(float) scanf() msub3, msub4, &printf() for msub5 (float) formatted i/o. 1. Start 2. Define variables: name, rollno, msub1, msub2, msub3, msub4, msub5, msum, score 3. Take input from keyboard for all the input variables 4. Calculate the sum of marks of 5 subjects and also calculate the percentage score as: Msum = msub1 + msub2 + msub3 + msub4 + msub5; Score = msum 500 100 5. Display the name, roll number and percentage score. 6. Stop

454/ From the Book: Capsules of C Programming #include<stdio.h> #include<conio.h> int main(void) { char name[20]; introllno; float msub1, msub2, msub3, msub4, msub5, msum, score; printf("enter Name of Student: "); scanf("%[^\n]", name); /*can use scanf( %s,name) but it reads single word only.*/ printf ("\nroll Number: "); scanf("%d", &rollno); printf ("\nenter Marks in 5 Subjects:\n"); scanf("%f%f%f%f%f", &msub1, &msub2, &msub3, &msub4, &msub5); msum=msub1+msub2+msub3+msub4+msub5; score = msum/500*100; printf("\nname of Student: %s", name);

printf("\nroll Number: %d", rollno); printf ("\npercentage Score Secured: %2.2f%c", score,'%'); return 0; } Output (Compilation, Debugging & Testing): Enter Name of Student: Shree HariKoirala Roll Number: 522 Enter Marks in 5 Subjects: 45.5 50 63 76 62.5 Name of Student: Shree HariKoirala Roll Number: 522 Percentage Score Secured: 59.40% Discussion & Conclusion: C Programming Lab Sheets /455 In this second lab of C Programming, based on the focused objective(s) to understand about C data types with formatted input/output functions, the additional lab exercises made me more confident towards the fulfillment of the objectives. Lab exercises (please code yourself and show the output to instructor): 1. Write a program to declare two integer and one float variables then initialize them to 10, 15, and 12.6. Also print the variable values in the screen. 2. Write a C program to prompt the user to input 3 integer values and print these values in forward and reversed order. 3. Write a program to calculate simple and compound interest. 4. Write a program to swap two variables values with and without using third variables 5. Write a program to check odd or even number (a) using modulus operator (b) using bitwise operator (c) without using bitwise and modulus operator (d) using conditional operator. 6. Print the value of y for given x=2 & z=4 and analyze the output. a. y = x++ + ++x; b. y= ++x + ++x; c. y= ++x + ++x + ++x; d. y = x>z; e. y= x>z? x:z; f. y = x&z; g. y= x>>2 + z<<1; 7. Write a program to print the size of char, float, double and long double data types in C LAB SHEET #3 To be familiar with formatted and unformatted I/O in C with preprocessor directives

456/ From the Book: Capsules of C Programming Write a program to do the following a. Get input of two float numbers in to variables x & y. receive the mathematical operator (+, -, *, /) using unformatted I/O into the variable Ch1 and perform operations on x & y and display the result. b. Define the math operator + as PLUS, - as MINUS, * as MULT & / as DIVIDE using preprocessor directives and do the operations over variables (x,y) defined on above question like z=x PLUS y. c. Get input of your name, address, age in years, weight and height from keyboard and display the information using unformatted I/O (String I/O). 1. Write a program to produce the output as shown below: x y expressions results 6 3 x=y+3 x=6 6 3 x=y-2 x=1 6 3 x=y*5 x=15 6 3 x=x/y x=2 6 3 x=x%y x=0 2. Given x=3.0, y=12.5, z= 523.3, A=300.0, B=1200.5, C=5300.3, Write a program to display the following: X y z= 3.0 12.5 523.3 A B C= 300.0 1200.5 5300.3 --------------------------------------------------------------------- X y z= 3.00 12.50 523.30 A B C= 300.00 1200.50 52300.30 3. Given the three numbers a(=8), b(=4),c and constant value PI=3.1415, calculate and display the following result using macros (preprocessor directives) a. c = PI * mult(a,b) //the macro mult(a,b) perform the multiplication of a & b(a*b) b. c= PI* sum(a,b) //the macro mult(a,b) perform the sum of a & b (a+b) c. c= PI *sub(a,b) //the macro mult(a,b) perform the subtraction of a & b (a-b)

C Programming Lab Sheets /457 d. c= PI*div(a,b) //the macro mult(a,b) perform the division of a & b (a/b) 4. Demonstrate the differences among getch(), getche(), getchar(). Demonstrate the difference between scanf() & gets(), printf() & puts(). 5. Write a program to take a character input from keyboard and check if it is a number or alphabet or special character using ASCII CODE Again check if the character is using character functions below: a. Alphanumeric => isalnum() b. Blank character => isblank() c. Alphabetic => isalpha() d. Control character => iscntrl() e. Number-digit => isdigit() f. Upper case => isupper() g. Lower case => islower() h. Hexadecimal digit => ixdigit() i. Graphical character => isgraph() LAB SHEET #4 To understand the programming knowledge using Decision Statements (if, if-else, ifelse if ladder, switch and GOTO) Write a program to input marks of 5 subjects (Physics, Chemistry, Math, English& Biology) for a student. Display the rank of each subjects and also the result of total marks and percentage obtained with his/her rank in the class. The rank is categorized as fail (marks < 40%), pass & third division (marks between 40 to 55%), second (marks between 55 to 65%), first (marks between 65 to 80%), Distinction (marks between 80 to 95%), extra ordinary (marks above 95 to 100%). 1. Write a program to find the largest and smallest among three entered numbers and also display whether the identified largest/smallest number is even or odd. 2. Write a program to check whether input alphabet is vowel or not using if-else and switch statement.

458/ From the Book: Capsules of C Programming 3. Write a program to get input of two or higher digit integer number and display in reverse order. 4. Write a program that asks a number and test the number whether it is multiple of 5 or not, divisible by 7 but not by eleven. 5. Write a program to check whether the entered year is leap year or not (a year is leap if it is divisible by 4 and divisible by 100 or 400.) 6. Write a program to read the values of coefficients a, b and c of a quadratic equation ax 2 +bx+c=0 and find roots of the equation. LAB SHEET #5 To understand the programming using Loop & nested loop Statements (for, while, do-while) Write a program to find sum as Y of the following series excluding prime numbers in the series. Y = 1 + 1 1! + 22 2! + 32 3! + + 102 10! 1. Write a program to input two integer numbers and display the sum of even numbers between these two input numbers. 2. Write a program to find GCD (greates common divisor or HCF) and LCM (least common multiple) of two numbers. 3. Write a program to display Fibonacci series of last term up to 300. 4. Write a program to display the flag of Nepal using symbolic/hex character in C.

C Programming Lab Sheets /459 5. Write a program to display the following. a. b. c. d. LAB SHEET #6 To understand function programming, its types and function-call Write a program to find sum as Y of the following series excluding prime number in the series. (Write function program to check whether the number is prime or not. also write recursive function to calculate the factorial of the series numbers). Y = 1 + 1 + 22 + 32 + + 102 1! 2! 3! 10! 1. Write a program to add, subtract, multiply and divide two integers using user defined type function with return type. 2. Write a program to calculate sum of first 50 natural numbers using recursive function. 3. Define a function named fact() to calculate factorial of a number n and then write a program that uses this function fact() to calculate combination and permutation. 4. Write a recursive function to generate Fibonacci series. 5. Write a program that illustrates use of local, global and static variables LAB SHEET #7 To understand programming using different dimensions of Array.

460/ From the Book: Capsules of C Programming Write a program to find separately the sum of the positive and negative integer elements of an array of size 10. Pass this array to a function called sortarray(int[]) and display the array elements into ascending order. 1. Write a program to enter 10 floating numbers in an array and display it. 2. Write a program to display largest and smallest element of an array defined in Q.No. 1. 3. Write a program to initialize one dimensional array of size 8 and display the sum and average of array elements 4. Write a program to read two matrices of order 3 * 2, add them and display the resultant matrix in matrix form. 5. Write a program to multiply two 3*3 matrix. 6. Write a program to read a string and check for palindrome without using string related function (a string is palindrome if its half is mirror by itself eg: abcdcba). LAB SHEET #8 To understand programming with Pointer, String and Function call by reference. Write a program to find separately the sum of the positive and negative integer elements of an array of size 10. Pass the positive and negative elements to separate functions eg: sumpositive(int*), sumnegative(int*) to carry out its sum. Also pass this array to a function called sortarray(int[]) and display the array elements into ascending order using pointer. 1. Write a program to find biggest among three numbers using pointer. 2. Write a program to find the sum of all the elements of an array using pointers. 3. Write a program to swap value of two variables using pointer. 4. Write a program to read a sentence and count the number of characters &words in that sentence. 5. Write a program to read a sentence & delete all the white spaces. Replace all. by :.

C Programming Lab Sheets /461 6. Write a program to copy one string to another string with and without using string handling function. 7. Write a program to concatenate two strings. 8. Write a program to compare two strings. 9. Write a program to sort 5 string words stored in an array of pointers. 10. Write a program to print the following pattern U N U N I V U N I V E R U N I V E R S I U N I V E R S I T Y U N I V E R S I U N I V E R U N I V U N LAB SHEET #9 To understand programming with Structure. Write a program to read RollNo, Name, Address, Age & marks in physics, C, math in 1 st semester of three students in BCT and display the student details with average marks achieved. 1. Create a structure named company which has name, address, phone and noofemployee as member variables. Read name of company, its address, phone and noofemployee. Finally display these members value. 2. Write a program to enter to Cartesian coordinate points and display the distance between them. 3. Write a function which accepts structure as argument and returns structure to the calling program. 4. Pass the structures defined in Question 1 into a function and read the structure member and display the values from the function (use structure pointer).

462/ From the Book: Capsules of C Programming 5. Define a structure complex (typedef) to read two complex numbers and perform addition, subtraction of these two complex numbers and display the result. 6. Write a program to read RollNo, Name, Address, Age & average-marks of 12 students in the BCT class and display the details from function. 7. Write a program to show programming examples with union and enumerations. LAB SHEET #10 To understand data files and file handling in C. Write a program to read RollNo, Name, Address, Age & marks in physics, C, math in 1 st semester of three students in BCT. Store the records into a file std.txt located at d:\ drive. Display the student details with average marks achieved (use data files record I/O). 1. Write characters into a file filec.txt. The set of characters are read form the keyboard until an enterkey is pressed (use putc() and getc() function). 2. Read characters form file filec.txt created in question 1. Also count the number of characters in the file (use fputs() and fgets() function). 3. Write set of strings each of length 40 into a file stringc.txt and display it (use fputs() and fgets() function). 4. Write name, age and height of a person into a data file person.txt and read it (use fprintf() and fscanf() function) 5. Write a program to replace DOS command type by watch. The watch command is to be created by C program watch.c and read the file filec.txt written in question no 1. (In DOS, we use the command like #type filec.txt which is to be replaced like #watch filec.txt) LAB SHEET #11 To be familiar with graphics programming in C. Write a program to draw following using C-Graphics using graphics header graphics.h

C Programming Lab Sheets /463 1. A circle having radius 100 pixels and center at point (150,250). 2. Two concentric circles having center point at (100,100). The inner circle should have radius 50 and outer have 75 pixels. 3. A rectangle which has left top corner point at (50, 75) and right bottom point at (200,250). 4. A rectangle having a diagonal of length 100 pixels and its one end at point (10, 20). 5. An ellipse having xradius=100, yradius=50 and center atpoint (100, 50). LAB SHEET #12 To be familiar with constants, variables, operators, formatted IO and control statements using FORTRAN programming. Write a FORTRAN Program which reads in a temperature in either Fahrenheit or degree centigrade and compute and print out the temperature in opposite scale. 1. Write A FORTRAN Program (WAFP) to display Welcome to Fortran Language. 2. Write a FORTRAN program to read three integers of same width using I format specifier. 3. WAFP to read two real numbers in fractional form and display their sum in exponential form. 4. WAFP to read sex code (1: for male & 2: for female) from user and display corresponding sex using computed GOTO statement) 5. WAFP to read a number from keyboard and display whether it is positive, negative or zero. 6. WAFP to find factorial of a number. 7. WAFP to find greatest among five numbers stored in an array. 8. WAFP to read marks of 10 students in a subject and display top three marks. 9. WAFP to read two matrix of size 3X3 and display the sum matrix. Also display the transpose of the first matrix.