answersLogoWhite

0


Best Answer

#include<stdio.h>

#define size 100

int main(){

int x[size], sum=0;

float average;

for(int i=0;i<size;i++){

scanf("%d",x[i]);

sum+=x[i];

}

average=sum/size;

printf("The Average is :\t%d",average);

return 0;

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write macro programs to calculate average of n numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What virus attaches to documents such as word or excel files?

Macro viruses use Microsoft Word and Excel's capabilities to embed code and programs into the document. When the document is opened, the macro virus is executed and infects your computer.


What is macro processor and explain features of macro facility?

features:-conditional macro expansionconcatenation of macro parametersgeneration of unique labelsmacro instruction argumentsexpansion time variablesexpansion time loops


Small programs that group a series of commands to run as a single command?

A Macro


What programs are most likely by a macro virus?

Microsoft Word and similar applications.


What is null macro?

The NULL macro is an implementation-defined macro. It is used to symbolise the zero address (0x0) in C programs and older C++ programs. It is not type safe, but is the conventional method of assigning the zero address to a pointer variable. C++11 introduced the type-safe nullptr data type.


What programs are affected by a macro virus?

In computing terminology, a macro virus is a virus that is written in a macro language: that is to say, a language built into a software application such as a word processor. Since some applications (notably, but not exclusively, the parts of Microsoft Office) allow macro programs to be embedded in documents, so that the programs may be run automatically when the document is opened, this provides a distinct mechanism by which viruses can be spread. This is why it may be dangerous to open unexpected attachments in e-mails. Modern antivirus software detects macro viruses as well as other types.


How do you divide two numbers in a macro?

#define TOTAL_NUM_FFTS ((int) (NO_SAMPLES) / (FFT_SIZE))


Why wont your C plus plus programs compile?

C++ programs won't compile if they contain compiler errors. The compiler will tell you precisely where the error is, and the type of error, unless the error is in a macro. The compiler cannot see macro definitions because they are inline expanded prior to compilation.


What is macro nutrition?

Macro nutrition is looking at you caloric intake from the perspective of protein, carbohydrates and fats. Macro numbers like 50/30/20 means that you get 50% of calories from protein, 30% from carbohydrates and 20% from fat. Different goals require different macro numbers, as well as different people have different macros to fulfill their fitness needs. This is opposed to micro nutrition that keeps track of vitamins, minerals, amino acids, etc.


What is the difference between executing a macro and calling a macro?

Calling a macro loads the macro into memory, while executing the macro runs the macro.


What programs was likely effected by a macro virus?

Although many of early macros viruses affected Microsoft Office applications (Word, Excel and others), these viruses can strike any application with a macro language including some operating systems.


What is macro call?

Nested macro calls refer to the macro calls within the macros. A macros is available within other macro definitions also. In the scenario when a macro call occurs, which contains another macro call, the macro processor generates the nested macro definition as text and places it on the input stack. The definition of the macro is then scanned and the macro processor complies it.