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


Please Help Members By Posting Answers For Below Questions

What is the sizeof () operator?

618


What are the uses of null pointers?

588


Are there constructors in c?

588


What is void c?

560


Explain how can a program be made to print the name of a source file where an error occurs?

682






What is a dynamic array in c?

587


What is wrong with this statement? Myname = 'robin';

813


hi any body pls give me company name interview conduct "c" language only

1661


How reliable are floating-point comparisons?

621


What is the purpose of ftell?

595


int i=10; printf("%d %d %d", i, i=20, i);

1006


What language is lisp written in?

613


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

640


Why do we use c for the speed of light?

603


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

1584