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.
Relational Operators A relational operator is used to make comparison among two values. All these operators are binary and needs two operands. There are the following relationa
Operation on array: void Array::add( Object& toAdd ) { lastElementIndex++; while( ptrAt( lastElementIndex ) != ZERO && lastElementIndex
Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send
The default Constructor and Destructor If you fail to write a constructor and destructor function, the compiler automatically supplies them for you. These functions have publi
Define the Conditional Operator in c language? The Simple conditional operator can be carried out with the conditional operators (? And :). An expression that makes use of the
Make QtAV Videoplayer simple integrateable for Qt Applications Project Description: I'm preparing an application for Windows and Mac using QtCreator. I want a videoplayer
Project Description: I want an app that the user can download it from the play store and use it as a keyboard for texts and writing. Just like the Samsung keyboard and the arabi
Write a program that does the following: Calculates the Velocity and Momentum of an object. The formula for the velocity is V=d/t and the formula Momentum is m=mass*velocity. Your
I have a mini project where I need to write a code .wonder if someone can help me.I already have the forms and webmaster page done just need to code portion
#C Why don''t online compilers support the header file? What can I do to resolve this? PS. I have tried , does''nt work either. Thannk in advance.
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