Skip to main content

C program to calculate average of using Array ( C program Coding )

Coding—
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],I,sum=0;
clrscr();
float avg;
 printf("Enter 5 array element");
     for(i=0;i<=4;i++)
      {
       scanf("%d",&a[i]);
      sum=sum+a[i];
       avg=sum/5;
      }
     printf("array of=%f",avg);
getch();
}

Output—
Enter 5 array element 34
67
36
27
57
array of =44.000000
       
        (๐Ÿ™‚Amar Singh sisodiya๐Ÿ™‚)


Comments

Popular posts from this blog

What is HTML or HTML tags

HTML 1) HTML stands for Hyper Text Markup Language 2) Created by Ten Berners-Lie in 1991 but published in 1995 3) It is Client side web technology. 4) It has predefined elements are called tags, used to"markup" a text documents. HTML TAGS 1 <html>_____</html>     Declare the Web page to be written in HTML. 2 <head>_____</head>       Delimits the pages head. 3 <title>______</title>       Defines the title.(not display on the page) 4 <body>_____</body>      Delimits the pages body. 4 <hn>_____</hn>      Delimits a level in heading. 5 <b>_____</b>      Set in boldface 6 <i>_____</i>       Set in italics. 7 <center>_____</center>      Center on the page horizontal. 8 <ul>_____</ul>     ...

Dalton's Atomic Theory—(Chemistry)

Dalton's Atomic Theory The theory that' all matter is made up of very tiny indivisible particles (atoms)' is called atomic theory of matter. Dalton's put forward his Atomic Theory of matter in 1808. The various postulates of Dalton's atoAto Theory of matter are as follows: All the matter is made up of very small particles called 'atoms'. Atoms cannot be divided. Atoms can neither be created nor destroyed Atoms are of various kinds. There are as many kinds of atoms as are elements. All the atoms of a given element are identical in every respect, having the same mass, size and chemical properties. Atoms of different elements differ in mass, size and chemical properties. Chemical combination between two elements consists in the joining together of atoms of these elements to form molecules of compounds. Drawbacks of Dalton's Atomic Theory It is now known that some of the statements of Dalton's Atomic Theory of matter are not exactly corre...

Operator Overloading // In Hindi or English // C++TUTORIAL

  Operator Overloading เค†เคœ เคนเคฎ เคœाเคจेंเค—े Operator overloading เค•्เคฏा เคนोเคคा เคนै:― Operator Overloading — Operator เคนเคฎेเคถा program เค•े datatype เค•े เคธाเคฅ เค•ाเคฎ เค•เคฐเคคा เคนै। เคœैเคธे int, float, char เคฒेเค•िเคจ เคœเคฌ เคนเคฎ เค…เคชเคจा datatype เค…เคฒเค— เคธे เคฌเคจाเคคे เคนैं, เคคो เค‡เคธे เคนी เคนเคฎ Operator Overloading เค•เคนเคคे เคนैं।       เคฏे user define data type เคชे เค•ाเคฎ เค•เคฐเคคा เคนै।เค…เคฅเคตा เคฏे เคนเคฎाเคฐे basic data type เคชे work เค•เคฐเคคा เคนै। In English― T he way operators work for user-defined types like objects and structures. This is known as operator overloading. For example, Suppose we have created three objects c1 , c2 and result from a class named Complex. เค…เค—เคฐ เค†เคชเค•ो เคฏे post เค…เคš्เค›ी เคฒเค—ी เคนो เคคो เคนเคฎे comment เค•เคฐ เค•े เคœเคฐूเคฐ เคฌเคคाเคं।