際際滷

際際滷Share a Scribd company logo
//Program for array of a stucture
#include<stdio.h>
#include<conio.h>
void main()
{
struct employee
{
int id;
char n[20];
char des[30];
char dept[30];
float sal;
};
struct employee e[50];
int i,no;
clrscr();
printf("enter the no.of employees:n");
scanf("%d",&no);
printf("enter the details for %d personsn",no);
printf("emp_id,emp_name,emp_des,emp_dept &emp_salaryn");
for(i=0;i<no;i++)
{
scanf("%d%s%s",&e[i].id,&e[i].n,&e[i].des);
scanf("%s%f",&e[i].dept,&e[i].sal);
}
printf(""n**O/Pn");
printf("nemp_idtemp_nametemp_destemp_dept temp_salaryn");
for(i=0;i<no;i++)
{
printf("%d%s%s",e[i].id,e[i].n,e[i].des);
printf("%s%f",e[i].dept,e[i].sal);
printf("n");
}

getch();
}
O/P**
emp_id emp_name         emp_des           emp_dept       emp_salary

1      hemant          s/w_developer      s/w._company   20000
2      sara            Lecturer           CSE            22000
3      charan          Lecturer            IT            25000
//Program for nested structure
#include<stdio.h>
#include<conio.h>
void main()
{
struct address
{
char land[30];
int strtno;
int hno;
char city[20];
};
struct date
{
int d;
int m;
int y;
};
struct person
{
int id;
char n[20];
int age;
struct date D;
struct address A;
};
struct person p;
int x;
clrscr();

printf("enter the details of the person:n");
printf("Id,name, agen");
scanf("%d%s%d",&p.id,&p.n,&p.age);
x=strupr(p.n);
//printf("%s",x);
printf("enter DOBn");
scanf("%d%d%d",&p.D.d,&p.D.m,&p.D.y);
printf("enter address land,strtno,hno,cityn");
scanf("%s%d%d%s",&p.A.land,&p.A.strtno,&p.A.hno,&p.A.city);
printf("nOUTPUT*n");
printf("ID=%dnNAME=%snAGE=%dnDOB=%d/%d/%dnADDRESS=%st%dt%dt%s"
,p.id,x,p.age,p.D.d,p.D.m,p.D.y,p.A.land,p.A.strtno,p.A.hno,p.A.city);
getch();
}
Enter the details of the person:
Id,name,age
12
sara
24
enter DOB
05
04
1987
enter address land,strtno,hno,city
Mahakali_colliery
20
N/17
Chandrapur
***OUTPUT
ID=12
NAME=SARA
AGE=24
DOB=05/04/1987
ADDRESS=Mahakali_colliery 20 N/17 Chandrapur
Ad

Recommended

Linear search
Linear search
Hitesh Kumar
Programa2
Programa2
fabiorodriguez123
Insertion sort
Insertion sort
Hitesh Kumar
Array imp of list
Array imp of list
Elavarasi K
One dimensional operation of Array in C- language
One dimensional operation of Array in C- language
9096308941
C語 ろ磯 螳襭 - 1谿
C語 ろ磯 螳襭 - 1谿
Junha Jang
Circular queue
Circular queue
ShobhaHiremath8
Include
Include
Angie Borda
(Meta 5) ejemplo vectores 2 dev c++
(Meta 5) ejemplo vectores 2 dev c++
Eli Diaz
(Meta 5) ejemplo vectores dev c++
(Meta 5) ejemplo vectores dev c++
Eli Diaz
10 3 れ 覦一
10 3 れ 覦一
Changwon National University
C & Python Introduction
C & Python Introduction
mohamedsaad24
1 (1)
1 (1)
Krish Na
Binary search
Binary search
Hitesh Kumar
week-21x
week-21x
KITE www.kitecolleges.com
Program in C language to implement linear search using pointers
Program in C language to implement linear search using pointers
Dr. Loganathan R
2 d rotation
2 d rotation
Chandu Kumare
Ds
Ds
kooldeep12345
Data Structures : array operations in c program
Data Structures : array operations in c program
Raghavendra Narayan
Final ds record
Final ds record
Ganisius Ganish
C program to implement linked list using array abstract data type
C program to implement linked list using array abstract data type
loyola ICAM college of engineering and technology
C Language Programs
C Language Programs
Mansi Tyagi
Pulse 2013 Mobile Build and Connect presentation
Pulse 2013 Mobile Build and Connect presentation
Leigh Williamson
UK Innovate 2012 mobile keynote
UK Innovate 2012 mobile keynote
Leigh Williamson
Jerry Romanek series mobile development 2012 year end review
Jerry Romanek series mobile development 2012 year end review
Leigh Williamson
IBM Presentation for Mobile Developer Summit India
IBM Presentation for Mobile Developer Summit India
Leigh Williamson
DevBeat 2013 IBM Master Class presentation
DevBeat 2013 IBM Master Class presentation
Leigh Williamson
June 25 webcast adding mobile to power applications
June 25 webcast adding mobile to power applications
Leigh Williamson
Mobile Testing Presentation at IBM Pulse 2013
Mobile Testing Presentation at IBM Pulse 2013
Leigh Williamson
IBM InterConnect Build and Deploy MobileFirst Applications
IBM InterConnect Build and Deploy MobileFirst Applications
Leigh Williamson

More Related Content

What's hot (14)

(Meta 5) ejemplo vectores 2 dev c++
(Meta 5) ejemplo vectores 2 dev c++
Eli Diaz
(Meta 5) ejemplo vectores dev c++
(Meta 5) ejemplo vectores dev c++
Eli Diaz
10 3 れ 覦一
10 3 れ 覦一
Changwon National University
C & Python Introduction
C & Python Introduction
mohamedsaad24
1 (1)
1 (1)
Krish Na
Binary search
Binary search
Hitesh Kumar
week-21x
week-21x
KITE www.kitecolleges.com
Program in C language to implement linear search using pointers
Program in C language to implement linear search using pointers
Dr. Loganathan R
2 d rotation
2 d rotation
Chandu Kumare
Ds
Ds
kooldeep12345
Data Structures : array operations in c program
Data Structures : array operations in c program
Raghavendra Narayan
Final ds record
Final ds record
Ganisius Ganish
C program to implement linked list using array abstract data type
C program to implement linked list using array abstract data type
loyola ICAM college of engineering and technology
C Language Programs
C Language Programs
Mansi Tyagi
(Meta 5) ejemplo vectores 2 dev c++
(Meta 5) ejemplo vectores 2 dev c++
Eli Diaz
(Meta 5) ejemplo vectores dev c++
(Meta 5) ejemplo vectores dev c++
Eli Diaz
C & Python Introduction
C & Python Introduction
mohamedsaad24
Program in C language to implement linear search using pointers
Program in C language to implement linear search using pointers
Dr. Loganathan R
Data Structures : array operations in c program
Data Structures : array operations in c program
Raghavendra Narayan
C Language Programs
C Language Programs
Mansi Tyagi

Viewers also liked (9)

Pulse 2013 Mobile Build and Connect presentation
Pulse 2013 Mobile Build and Connect presentation
Leigh Williamson
UK Innovate 2012 mobile keynote
UK Innovate 2012 mobile keynote
Leigh Williamson
Jerry Romanek series mobile development 2012 year end review
Jerry Romanek series mobile development 2012 year end review
Leigh Williamson
IBM Presentation for Mobile Developer Summit India
IBM Presentation for Mobile Developer Summit India
Leigh Williamson
DevBeat 2013 IBM Master Class presentation
DevBeat 2013 IBM Master Class presentation
Leigh Williamson
June 25 webcast adding mobile to power applications
June 25 webcast adding mobile to power applications
Leigh Williamson
Mobile Testing Presentation at IBM Pulse 2013
Mobile Testing Presentation at IBM Pulse 2013
Leigh Williamson
IBM InterConnect Build and Deploy MobileFirst Applications
IBM InterConnect Build and Deploy MobileFirst Applications
Leigh Williamson
Build and Connect Enterprise Mobile Applications from developerWorks Live!
Build and Connect Enterprise Mobile Applications from developerWorks Live!
Leigh Williamson
Pulse 2013 Mobile Build and Connect presentation
Pulse 2013 Mobile Build and Connect presentation
Leigh Williamson
UK Innovate 2012 mobile keynote
UK Innovate 2012 mobile keynote
Leigh Williamson
Jerry Romanek series mobile development 2012 year end review
Jerry Romanek series mobile development 2012 year end review
Leigh Williamson
IBM Presentation for Mobile Developer Summit India
IBM Presentation for Mobile Developer Summit India
Leigh Williamson
DevBeat 2013 IBM Master Class presentation
DevBeat 2013 IBM Master Class presentation
Leigh Williamson
June 25 webcast adding mobile to power applications
June 25 webcast adding mobile to power applications
Leigh Williamson
Mobile Testing Presentation at IBM Pulse 2013
Mobile Testing Presentation at IBM Pulse 2013
Leigh Williamson
IBM InterConnect Build and Deploy MobileFirst Applications
IBM InterConnect Build and Deploy MobileFirst Applications
Leigh Williamson
Build and Connect Enterprise Mobile Applications from developerWorks Live!
Build and Connect Enterprise Mobile Applications from developerWorks Live!
Leigh Williamson
Ad

Similar to Structure (20)

C basics
C basics
MSc CST
C programms
C programms
Mukund Gandrakota
SaraPIC
SaraPIC
Sara Sahu
Arrays
Arrays
mohamed sikander
C programming structure & pointer
C programming structure & pointer
argusacademy
Array Programs.pdf
Array Programs.pdf
RajKamal557276
Cpd lecture im 207
Cpd lecture im 207
Syed Tanveer
Chapter 8 c solution
Chapter 8 c solution
Azhar Javed
C lab manaual
C lab manaual
manoj11manu
Data structure new lab manual
Data structure new lab manual
SANTOSH RATH
C file
C file
simarsimmygrewal
ADA FILE
ADA FILE
Gaurav Singh
InsertionSort.pdf
InsertionSort.pdf
mayanksanjay007
Os lab upto_1st_mid
Os lab upto_1st_mid
Murali Kummitha
Os lab 1st mid
Os lab 1st mid
Murali Kummitha
Os lab upto 1st mid
Os lab upto 1st mid
Murali Kummitha
4. chapter iii
4. chapter iii
Chhom Karath
Bubble Sort
Bubble Sort
Er. Ganesh Ram Suwal
Data Structure in C Programming Language
Data Structure in C Programming Language
Arkadeep Dey
Program to sort the n names in an alphabetical order
Program to sort the n names in an alphabetical order
Samsil Arefin
C basics
C basics
MSc CST
C programming structure & pointer
C programming structure & pointer
argusacademy
Cpd lecture im 207
Cpd lecture im 207
Syed Tanveer
Chapter 8 c solution
Chapter 8 c solution
Azhar Javed
C lab manaual
C lab manaual
manoj11manu
Data structure new lab manual
Data structure new lab manual
SANTOSH RATH
Data Structure in C Programming Language
Data Structure in C Programming Language
Arkadeep Dey
Program to sort the n names in an alphabetical order
Program to sort the n names in an alphabetical order
Samsil Arefin
Ad

Structure