what is array?

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


Please Help Members By Posting Answers For Below Questions

What is the value of uninitialized variable in c?

560


shorting algorithmS

1788


What is the difference between far and near ?

674


Explain what is the difference between a free-standing and a hosted environment?

623


what is the function of pragma directive in c?

609






Explain the difference between getch() and getche() in c?

554


1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if

3971


What is a global variable in c?

581


write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.

4971


How to find a missed value, if you want to store 100 values in a 99 sized array?

803


Explain what are the standard predefined macros?

642


What do you mean by dynamic memory allocation in c?

637


What is the difference between the expression “++a” and “a++”?

642


can any one provide me the notes of data structure for ignou cs-62 paper

1692


Why do some versions of toupper act strangely if given an upper-case letter?

622