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
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
Can you define which header file to include at compile time?
What are examples of structures?
What is union and structure in c?
What are the 4 types of organizational structures?
What is hashing in c?
Can an array be an Ivalue?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
Explain how can you restore a redirected standard stream?
What is the meaning of && in c?
Why do we use pointer to pointer in c?
Are pointers really faster than arrays?
What is pivot in c?
List the different types of c tokens?
Which built-in library function can be used to match a patter from the string?