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
Explain the use of function toupper() with and example code?
Is it acceptable to declare/define a variable in a c header?
Why main is not a keyword in c?
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
What is file in c preprocessor?
What does s c mean on snapchat?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
What are the different categories of functions in c?
How do you print only part of a string?
Explain what is a 'locale'?
Does c have class?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
Write a program to find factorial of a number using recursive function.
Difference between constant pointer and pointer to a constant.
Explain how are 16- and 32-bit numbers stored?