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 is C language being considered a middle level language?
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?
How can I read/write structures from/to data files?
Why is c faster?
What is the difference between if else and switchstatement
How can you call a function, given its name as a string?
Write a code to determine the total number of stops an elevator would take to serve N number of people.
What is the meaning of typedef struct in c?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
Can include files be nested?
Write a program to check palindrome number in c programming?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
Function calling procedures? and their differences? Why should one go for Call by Reference?
What is infinite loop?
what are # pragma staments?