Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
0 of .
Results for:
P. 1
Data Stuctures Lab Manual

# Data Stuctures Lab Manual

Ratings: (0)|Views: 2,832 |Likes:

### Availability:

See more
See less

11/03/2013

pdf

text

original

BIO-DATA
AIM:
To write a C-program to print the bio-data.
ALGORITHM:
Step:1 Start the program.Step:2 Read name, father’s name, city, age.Step:3 Enter the details.Step:4 Print the details.Step:5 Stop the program.
PROGRAM:
#include<stdio.h>#include<conio.h>void main(){char name, fathername, city;int age;clrscr(); printf(“Enter the name:”);scanf(“%s”,name); printf(“\n Enter the father’s name:”);scanf(“%s”,fathername); printf(\n Enter the city”);scanf(“%s”,city); printf(“\n Enter the age:”);scanf(“%d”,&age); printf(“\n Name:%s”,Name); printf(“\n Father’s Name:%s”,fathername); printf(“\n City:%s”,city); printf(“\n Age:%d”,age);getch();}
RESULT:
Thus the C-program to print the bio-data had been executed and the output was verified.

FLOWCHART: OUTPUT:
Enter the name: R. Siva Kumar Enter the Father’s name: M. Rajavel.Enter the city: Tiruchengode.Enter the age:21 Name: R. Siva Kumar.Father’s Name: M. Rajavel.City: Tiruchengode.Age: 21
STARTRead name, father name, city, agePrint name, father name, city, ageSTOP

AVERAGE OF ‘N’ NUMBERS
AIM:
To write a C-program to find the average of ‘n’ numbers.
ALGORITHM:
Step:1 Start the program.Step:2 Read n.Step:3 Enter the numbers.Step:4 Use for loop with condition i < n find its sum.Step:5 Calculate the average.Step:6 Stop the program.
PROGRAM:
#include<stdio.h>#include<conio.h>void main(){int a[20],i,n;float avg,s=0; printf(“Enter the number of element to be added”);scanf(“%d”,&n); printf(“\n Enter the numbers”);for(i=0;i<n;i++){Scanf(“%d”,&a[i]);}for(i=0;i<n;i++){s=s+a[i];}avg=s/n; printf(“The average of %d numbers=%f”,n,avg);getch();}
RESULT:
Thus the C-program to find the average of n numbers had been written and it is executed.