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!
Write a program to calculate the average of ten numbers #include stdio.h /* Only this header is needed since only IO are used */ void main() { char prompt; int i; float b[12]; float sum, average; for (i = 1;i <=10;i++) { /*Load up the array with the data*/ printf("Please enter in your number \n\r"); scanf("%f",&b[i]); /* Note that the index must be an integer Whole number of boxes */ } sum = 0.0; for (i = 1;i <=10;i++) { /* Calculate the sum of all the array elements*/ Sum += b[i]; } printf("The average of the following numbers\n\r "); /* Display the numbers from the array */ for (i = 1;i <=10;i++) { printf("%10.2f \n\r",b[i] ); } /*Calculate the average and display it */ average = sum / 10.0; printf("Is = %10.2f \n\r", Average ); printf("Press any key to exit \n\r"); scanf("\n%c",&prompt); }
Although we could have done this in one For loop, it shows that the numbers typed in are easily accessible any time within the program It is possible to extend the array to more than one dimension. Although with regards to memory there in no difference, we can consider each element (x) as a filing cabinet which contains (Y) files i.e.
A[2][3] cabinet 2 file 3
This technique is useful in data processing and matrix manipulation for graphics and CAD applications. We can think of a 2 dimension array (2x2) as a grid or matrix. A better technique of storage is that of the structure.
Program is to create a file student.dat: Program is to create a file student.dat which contains all name, roll_no,marks(5 sub) and percentage class student {
write a simple c++ program to that use the value to add five number .your program should prompt the user to enter these five numbers one after the other
defining software crisis As the technology changes rapidly the requirement for the users' change, to part the growing demand of the user for trade, business, and personal
how to call the value
A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome
finds the average for all assignments for an individual student float getAverageForStudent(float scores[20][10], int student, int numAssignments) { } // finds the average for
The game of hangman may have originated in the Victorian era, and involves trying to guess a word by suggesting letters. The game is played as follows: A word is chosen and the pl
Define inheritance?
C program to add, average and deviation of numbers: void main() { int sum=0,a[10],i; float avg=0,dev,vari=0,var; pri
Ask question #Minimum 100 words acceptedEducational Objectives: After completing this assignment, the student should be able to accomplish the following: Apply generic algorithms i
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