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.



plz answer.... write a program that reads line (using getline) e.g."345", converts each ..

Answer / 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

More C Interview Questions

What is the real difference between arrays and pointers?

27 Answers   Hexaware, Logic Pro, TCS,


Write a c program to print the sizes and ranges of different data types in c?

1 Answers  


What are inbuilt functions in c?

0 Answers  


why Language C is plateform dependent

3 Answers   Siemens, Wipro,


What is enumerated data type in c?

0 Answers  






In C language what is a 'dangling pointer'?

0 Answers   Accenture,


write a program to print data of 5 five students with structures?

0 Answers  


how many keywords are available in 'c' language a) 32 b) 34 c) 45 d) 48

1 Answers  


what is use of loop?

10 Answers   Infosys,


Explain built-in function?

0 Answers  


How can I call a function with an argument list built up at run time?

0 Answers  


What is the process to generate random numbers in c programming language?

0 Answers  


Categories