plz answer.... write a program that reads line (using
getline) e.g."345", converts each line to an integer
using "atoi" and computes the average of all the numbers
read. also compute the standard deviation.
Answer Posted / dally
#include<stdio.h
int main()
{
char array[]= "345";
int n;
n = atoi(array);
while(n>1)
{
int sum,aveg,no=1;
n = n%10;
no++;
sum = sum+n;
n=n/10;
}
aveg= sum/no;
printf("Aveg of number %d\n",aveg);
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What are logical errors and how does it differ from syntax errors?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
how can I convert a string to a number?
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
How can I write a function analogous to scanf?
Difference between MAC vs. IP Addressing
How do you define structure?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?
How can I read a binary data file properly?
Which is the best website to learn c programming?
int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.
What is s in c?