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 array in C

710


Explain about C function prototype?

611


Tell me what are bitwise shift operators?

658


How does sizeof know array size?

629


How can I send mail from within a c program?

581






What is meant by type casting?

629


What is 1d array in c?

602


Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?

603


What is the difference between array and structure in c?

571


What do you mean by dynamic memory allocation in c?

651


Can include files be nested? How many levels deep can include files be nested?

660


Explain what is the most efficient way to store flag values?

700


What is the usage of the pointer in c?

606


What is d'n in c?

637


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2226