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.
1. Basic Heap: Each memory location in our model of the RAM will be an instance of type Memory: 2. typedef union Memory_u Memory; 3. union Memory_u{ 4. char character;
We can combine more than one variable on the same line i.e. float number1,number2,number3; etc Sometimes we want to mix the variable types used on the same line, this could
pseudo code
Rahul is a newbie to the programming and while learning the programming language he came to know the following rules: ???• Each program must start with ''{'' and end with '
There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that
Problem Statement: You have to write a C program to develop a Car Parking Management System for a busy commercial area. The system will record the car plate number, date and time w
Optimized NIC Driver for Windows Compact 7 for Hard Real Time Communication Project Description: I am seeking an optimized driver (miniport driver) that will be used for sele
can you help with the assignment, I don''t want to upload the assignment but want somebody to work with, do you do that?
Introduction: This assignment requires a knowledge of variables (integers, char types), loops, conditionals, switch, functions, char arrays, string arrays, number arrays, struc
For the circuit shown in Figure, verify (a) the battery voltage V , (b) the total resistance of the circuit, and (c) the values of resistance of resistors R 1 , R 2 and
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: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd