Write a pascal programming to find the average of 3 numbers?
var b,c,d:integer; a:real; begin readln(b); readln(c); readln(d); a:=(b+c+d)/3; writeln(a:6:2); readln; end. So, let me explain this program a little bit, so maybe you can get it... or else you'll never learn. So we declared b,c,d as three integer numbers and a as a real one (because a is the number that represent the average, and the average may not be a natural number). We read the numbers (the three lines with readln), we tell the program that the a should get the value of (b+c+d)/3 and then we tell the program to write that value. The :6:2 means that the number wrote will have maximum 6 spaces before the dot, and maximum 2 after the dot. So the maximum number would be 999999.99; Well, I hope I helped!
How to write a program using while loop to find the sum of integers 73 through 415 inclusive?
a = 73; b = 415; sum = 0; while ( a <= b) { sum = sum + a; a++; } print "Sum is: ", sum; Written in generic code, since you did not specify a programming language.
How can I write C++ code that prints the sum, product, and average of three integers with two decimal place precision?
Source Code:#include
Program that reads a set of integers, and then finds and prints the sum of the even and odd integers C++?
This is what I have and for the life of me cannot get it to come out right any help is appreciated #include
Write C program that converts string to an integers and sums these values and prints the result at the screen?
What you've written is C++, not C. If that's the assignment, then add
How do I write a C program to add two floating point numbers?
It’s actually really hard to get this single line of C wrong if you have done primary school arithmetic.Give it a go.Write a main function, then put your single line inside it. Use printf to display the answer. You’ll need to lookup the conversion for ‘float’