Answer Posted / geetha gajendiran
a simple program using array
#include<stdio.h>
void main()
{
int avg,sum=0;
int i;
int pay[30];/*array declaration*/
for(i=0;i<=29;i++)
{
printf("\n enter payment:");
scanf("%d",&pay[i]);/*store data in array*/
}
for(i=0;i<=29;i++)
sum=sum+pay[i];/*read data from an array*/
avg=sum/30;
printf("\n average marks =%d",avg);
}
| Is This Answer Correct ? | 20 Yes | 2 No |
Post New Answer View All Answers
Why we use stdio h in c?
Explain the difference between null pointer and void pointer.
What is class and object in c?
Write a program in c to replace any vowel in a string with z?
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
What is the use of function in c?
What is malloc() function?
What are structural members?
What is LINKED LIST? How can you access the last element in a linked list?
What are loops c?
Do array subscripts always start with zero?
Explain high-order and low-order bytes.
What is the use of extern in c?
What are the loops in c?
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above