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

find the sum of two matrices and WAP for it.

632


What is static identifier?

704


What is c programing language?

612


What are qualifiers and modifiers c?

549


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

656






Does c have class?

613


What is a static variable in c?

667


what are the advantages of a macro over a function?

645


How many bytes are occupied by near, far and huge pointers (dos)?

668


Why does this code crash?

619


write a c program to calculate sum of digits till it reduces to a single digit using recursion

2718


What will be your course of action for a push operation?

665


How can I handle floating-point exceptions gracefully?

632


Explain what is output redirection?

666


the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

759