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
What is a global variable in c?
What is the purpose of sprintf?
Differentiate between ordinary variable and pointer in c.
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
What is the difference between text and binary modes?
Who developed c language?
What is a null pointer in c?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
Stimulate calculator using Switch-case-default statement for two numbers
Why do we need arrays in c?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
What is the difference between char array and char pointer?
Difference between Shallow copy and Deep copy?
What are reserved words?
How many keywords (reserve words) are in c?