SlideShare a Scribd company logo
4
Most read
ARRAY
#include<stdio.h>
int main()
{
float student1,student2,student3,student4,
student5,student6,student7,student8,student9
…………………….;
printf("enter 1st student mark:");
scanf("%f",&student1);
printf("enter 2nd student mark:");
scanf("%f",&student2);
printf("enter 3rd student mark:");
scanf("%f",&student3);
……………………………………………….}
ARRAY is a collection of data items
All of the same type
A common name
Array declaration syntax:
data_type arr_name [arr_size];
int mark[120];
Array
INDEX:
int mark[5];
mark[0]=45;
mark[1]=56;
mark[2]=40;
mark[3]=58;
mark[4]=78;
int mark[5]={45,56,40,58,78};
Size =[n] Index=( [0] – [n-1] )
#include<stdio.h>
int main()
{
int mark [5];
mark[0]=45;
mark[1]=56;
mark[2]=40;
mark[3]=58;
mark[4]=78;
printf("%d",num[0]); //try other index
}
#include<stdio.h>
int main()
{
int mark[5]={45,56,40,58,78};
printf("%d",num[0]); //try other index
}
#include<stdio.h>
main()
{
int num[5]={87,45,48,4,2};
int i;
for(i=0;i<=4;i++)
printf("num[%d]=%dn",i,num[i]);
}
#include<stdio.h>
main()
{
int num[5];
int i;
printf("enter student math markn");
for(i=0;i<=4;i++)
{ printf("student %d:",i+1);
scanf("%d",&num[i]);
}
printf("show student markn");
for(i=0;i<=4;i++)
{ printf("student%d math mark:%dn",i+1,num[i]); }
}
#include<stdio.h>
main()
{ int math[5],eng[5];
int i;
printf("enter student math markn");
for(i=0;i<=4;i++)
{ printf("student %d:",i+1);
scanf("%d",&math[i]);
}
printf("enter student english markn");
for(i=0;i<=4;i++)
{ printf("student %d:",i+1);
scanf("%d",&eng[i]);
}
printf("show student total markn");
for(i=0;i<=4;i++)
{printf("student%d total mark:%dn",i+1,math[i]+eng[i]); } }
Assignment:
Input 5 student name ,math mark,physics mark
and show name with total mark.

More Related Content

PPTX
Arrays In C++
PPT
C++ Arrays
PPTX
ARRAY
PPTX
Array in c programming
PPT
Unit 1 introduction to data structure
PPTX
PPTX
Unit 9. Structure and Unions
Arrays In C++
C++ Arrays
ARRAY
Array in c programming
Unit 1 introduction to data structure
Unit 9. Structure and Unions

What's hot (20)

PPT
Void pointer in c
PDF
SQL Queries - DDL Commands
PPTX
Priority queue in DSA
PPTX
Data Types - Premetive and Non Premetive
PDF
Python tuples and Dictionary
PPT
Enumerated data types in C
PPTX
Data structures
PPTX
Data structure array
PPTX
concept of Array, 1D & 2D array
PPTX
Datastructures in python
PPTX
Pointers and Dynamic Memory Allocation
PPTX
PPTX
Searching and sorting
PPTX
Stacks IN DATA STRUCTURES
PPTX
Pointer in c program
PPTX
Linked List
PPTX
Pointers in c++
PPTX
2. Array in Data Structure
PPTX
C programing -Structure
PPTX
Pointer in C
Void pointer in c
SQL Queries - DDL Commands
Priority queue in DSA
Data Types - Premetive and Non Premetive
Python tuples and Dictionary
Enumerated data types in C
Data structures
Data structure array
concept of Array, 1D & 2D array
Datastructures in python
Pointers and Dynamic Memory Allocation
Searching and sorting
Stacks IN DATA STRUCTURES
Pointer in c program
Linked List
Pointers in c++
2. Array in Data Structure
C programing -Structure
Pointer in C
Ad

Similar to Array (20)

PPTX
array ppt of c programing language for exam
PPTX
Module_3_Arrays - Updated.pptx............
PPT
Array THE DATA STRUCTURE. ITS THE STRUCT
PDF
arraysfor engineering students sdf ppt on arrays
PPTX
PPTX
PPt. on An _Array in C
PPTX
Array ppt you can learn in very few slides.
PDF
Array in C.pdf
PDF
Array.pdf
PPTX
Array.pptx Array.pptxArray.pptx Array.pptxArray.pptxArray.pptx
PPTX
PPT
presentation_arrays_1443553113_140676.ppt
DOCX
what is arrays in c language
PPTX
BHARGAVIARRAY.PPT.pptx
PPT
PPT
PDF
02 arrays
PPTX
ARRAY (specially for computer science students).pptx
PPT
Arrays in c
array ppt of c programing language for exam
Module_3_Arrays - Updated.pptx............
Array THE DATA STRUCTURE. ITS THE STRUCT
arraysfor engineering students sdf ppt on arrays
PPt. on An _Array in C
Array ppt you can learn in very few slides.
Array in C.pdf
Array.pdf
Array.pptx Array.pptxArray.pptx Array.pptxArray.pptxArray.pptx
presentation_arrays_1443553113_140676.ppt
what is arrays in c language
BHARGAVIARRAY.PPT.pptx
02 arrays
ARRAY (specially for computer science students).pptx
Arrays in c
Ad

Recently uploaded (20)

PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Sports Quiz easy sports quiz sports quiz
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Lesson notes of climatology university.
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Classroom Observation Tools for Teachers
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Cell Structure & Organelles in detailed.
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Pharma ospi slides which help in ospi learning
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Microbial diseases, their pathogenesis and prophylaxis
Sports Quiz easy sports quiz sports quiz
FourierSeries-QuestionsWithAnswers(Part-A).pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Lesson notes of climatology university.
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Classroom Observation Tools for Teachers
Microbial disease of the cardiovascular and lymphatic systems
Renaissance Architecture: A Journey from Faith to Humanism
Cell Structure & Organelles in detailed.
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Pharma ospi slides which help in ospi learning
human mycosis Human fungal infections are called human mycosis..pptx
Supply Chain Operations Speaking Notes -ICLT Program
Insiders guide to clinical Medicine.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx

Array