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 is the sizeof () operator?
What are the uses of null pointers?
Are there constructors in c?
What is void c?
Explain how can a program be made to print the name of a source file where an error occurs?
What is a dynamic array in c?
What is wrong with this statement? Myname = 'robin';
hi any body pls give me company name interview conduct "c" language only
How reliable are floating-point comparisons?
What is the purpose of ftell?
int i=10; printf("%d %d %d", i, i=20, i);
What language is lisp written in?
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
Why do we use c for the speed of light?
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?