Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
C Program for TOTAL & AVERAGE IN THE ARRAY
#include stdio.h>
#include conio.h>
#include string.h>
void main()
{
int i=0,n[100],limit=0,a=0;
float b;
clrscr();
for(i=0;i<100;i++)
n[i]=0;
}
printf("\nENTER THE LIMIT OF ELEMENTS: ");
scanf("%d",&limit);
for(i=0;i { printf("\nENTER THE %d ELEMENT: ",i+1); scanf("%d",&n[i]); a=n[i]+a; } b=a/i; printf("\nTHE TOTAL IS %d",a); printf("\nTHE AVG OF ALL NO IS %f",b); getch(); } OUTPUT : ENTER THE ELEMENTS : 3 ENTER THE 1 ELEMENTS : 10 ENTER THE 2 ELEMENTS : 10 ENTER THE 3 ELEMENTS : 10 THE TOTAL IS 30 THE AVG. OF ALL ELEMENTS : 10.000
printf("\nENTER THE %d ELEMENT: ",i+1);
scanf("%d",&n[i]);
a=n[i]+a;
b=a/i;
printf("\nTHE TOTAL IS %d",a);
printf("\nTHE AVG OF ALL NO IS %f",b);
getch();
OUTPUT :
ENTER THE ELEMENTS : 3
ENTER THE 1 ELEMENTS : 10
ENTER THE 2 ELEMENTS : 10
ENTER THE 3 ELEMENTS : 10
THE TOTAL IS 30
THE AVG. OF ALL ELEMENTS : 10.000
TO CONVERT A NUMBER OR A DIGIT INTO ALPHABET
Question : (a) Define a Pointer. Provide an example of an integer pointer variable. (b) Give advantages of using pointers over arrays. (c) Declare an integer pointer
The program will ask the user to enter: '1' to List the cities(and their state abbrev) from largest to smallest (by their population) with their population '2' to List the
There are two ways for initializes in C++ as shown in the example that follows. The first way uses the traditional C notation. The second way uses constructor notation. int foo
A: 1. By using const protects you against programming errors which inadvertently alter data. 2. By using const allows function to procedure const and non-const actu
Queue - C++ program: Write a program to show the basic operations on queue. namespace stack { const int max_size = 200; char v(max_size); int top=0; void pu
drawbacks in assignments in engeenirng
Operators The variables, which are declared and explained, are the operands, which are operated upon by the operators. Operators specify what operations are to be performed on
Why copy constructor accepts reference to an object and not the object itself, whether ah hence it we do otherwise
to calculate area of the circle
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd