SlideShare una empresa de Scribd logo
1 de 13
Descargar para leer sin conexión
WELCOME
 EE15 Rupali kirnapure
J D College Of Engineering & Management
B.TECH 1ST YEAR (2022-23)
Subject :-introduction to computer programimg
Branch :- Electrical Engineering
Topi c of presentation:-Structure
SUBMITED BY:-
STRUCTURE
•Structure is a mechanism for packing data of different types
into single unit. A structure is a convenient tools for
handling a group of logically related data items.
STRUCTURE DECLARATION
4
• Now, we have only created the format of a structure, but we still
did not declare any variable in which can store value. Thus there
is need to declare structure variable so that we can use the
structure members in the programs.
SYNTAX
Struct structure name
{
Data type d=1;
Data type d=2;
.
.
.
.
}
EXAMPLE
struct book
{
char author [30];
int price;
char publication[30];
}
STRUCTURE VARIABLE
•For using the structure you need structure variable.
•Syntax of structure variable are as follow:
Void main()
}
struct structure name structure variable;
For eg:-
struct book b1;b2;b3;
ARRAY OF STRUCTURE
If we need the detail of the 100 books,then it is difficult to
declare 100 structure variable using the above two
method,but this problem can be solved by array declaration
of structure variables.We can declare array of structures just
like we declare array of integers or array of variable of any
other data type.
EXXAMPLE
Struct book
{
char title][15];
char author[10];
int pages;
float price;
};
Struct book b[100 ];
Here, b[100] [declares 100 variable of structure type [book.
NESTED STRUCTURE
Nested structure in C is nothing but structure within
structure. > One structure can be declared inside other
structure as we declare structure members inside a
structure. >The structure variable can be normal structure
variable.
Program:-
#include<stdio.h>
#include<string.h>
struct address
{
char phone] [15];
char city [15];
int pin;
}a1;
struct emp
{ char name [15;
int emp_no;
foat salary;
}a1;
void main()
{
{
struct address e1;
a1.phone-8140733161;
a1.city="hansot";
a.pin_no.=393030;
}
{
struct emp e1;
et.name="Prakash";
e1.emp_no=2016;
e1.salary=15,500;
}
Printf("%s",a1.phone);
Printf(“%s",a1.city);
Printf("%d”,a1.pin);
Printf("%s",e1.name);
Printf("%d",e1.emp_no);
Printf("%f",e1.salary);
}
THANKYOU
Rupali Kirnapure

Más contenido relacionado

Similar a cprogram.pdf

Cs1123 12 structures
Cs1123 12 structuresCs1123 12 structures
Cs1123 12 structures
TAlha MAlik
 
Data Structure & Algorithm - Self Referential
Data Structure & Algorithm - Self ReferentialData Structure & Algorithm - Self Referential
Data Structure & Algorithm - Self Referential
babuk110
 

Similar a cprogram.pdf (20)

Ocs752 unit 5
Ocs752   unit 5Ocs752   unit 5
Ocs752 unit 5
 
Presentation on c structures
Presentation on c   structures Presentation on c   structures
Presentation on c structures
 
Presentation on c programing satcture
Presentation on c programing satcture Presentation on c programing satcture
Presentation on c programing satcture
 
Structure in c language
Structure in c languageStructure in c language
Structure in c language
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
 
01. introduction to data structures
01. introduction to data structures01. introduction to data structures
01. introduction to data structures
 
CP01.pptx
CP01.pptxCP01.pptx
CP01.pptx
 
Cs1123 12 structures
Cs1123 12 structuresCs1123 12 structures
Cs1123 12 structures
 
Data Structure & Algorithm - Self Referential
Data Structure & Algorithm - Self ReferentialData Structure & Algorithm - Self Referential
Data Structure & Algorithm - Self Referential
 
Programming in Civil Engineering_UNIT 3_NOTES
Programming in Civil Engineering_UNIT 3_NOTESProgramming in Civil Engineering_UNIT 3_NOTES
Programming in Civil Engineering_UNIT 3_NOTES
 
L6 structure
L6 structureL6 structure
L6 structure
 
Structure (Computer programming and utilization)
Structure (Computer programming and utilization)Structure (Computer programming and utilization)
Structure (Computer programming and utilization)
 
Structure and Enum in c#
Structure and Enum in c#Structure and Enum in c#
Structure and Enum in c#
 
A Modern Interface for Data Science on Postgres/Greenplum - Greenplum Summit ...
A Modern Interface for Data Science on Postgres/Greenplum - Greenplum Summit ...A Modern Interface for Data Science on Postgres/Greenplum - Greenplum Summit ...
A Modern Interface for Data Science on Postgres/Greenplum - Greenplum Summit ...
 
CHAPTER -4-class and structure.pptx
CHAPTER -4-class and structure.pptxCHAPTER -4-class and structure.pptx
CHAPTER -4-class and structure.pptx
 
UK INCOSE Annual Systems Engineering Conference. Case Study - Implementing TR...
UK INCOSE Annual Systems Engineering Conference. Case Study - Implementing TR...UK INCOSE Annual Systems Engineering Conference. Case Study - Implementing TR...
UK INCOSE Annual Systems Engineering Conference. Case Study - Implementing TR...
 
Standard Template Library!
Standard Template Library!Standard Template Library!
Standard Template Library!
 
Lk module4 structures
Lk module4 structuresLk module4 structures
Lk module4 structures
 
Research Sruti
Research SrutiResearch Sruti
Research Sruti
 
Coding - L30-L31-Array of structures.pptx
Coding - L30-L31-Array of structures.pptxCoding - L30-L31-Array of structures.pptx
Coding - L30-L31-Array of structures.pptx
 

Último

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Último (20)

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

cprogram.pdf