UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is a macro, and how do you use it?

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

Tutor of C, Core Java, having 5 years of development experience in DRDO, Bangalore and Honeywell

Macro is used where we want to use a value many times in a code. Also there is a possibility that the in future, the value would change. Then changing the value all over the code does not make any sense. There has to be a way out through which one can make the change at one place and it would get reflected...
read more
Macro is used where we want to use a value many times in a code. Also there is a possibility that the in future, the value would change. Then changing the value all over the code does not make any sense. There has to be a way out through which one can make the change at one place and it would get reflected at all the places read less
Comments

Programming Language Tutor

Macro refers to a #define definition that is used to define words to enhance readability and understandability of the program.It defines an identifier and string or constant that is substituted for the identifier each time it is encountered in the program.This identifier is called a macro and the replacement...
read more
Macro refers to a #define definition that is used to define words to enhance readability and understandability of the program.It defines an identifier and string or constant that is substituted for the identifier each time it is encountered in the program.This identifier is called a macro and the replacement procedure is termed macros substitution. example :- #define m 10 void main(){ int b,c; b=m+1; c=b*m; printf("%d\t%d",b,c); } In the above program, we consider two statement 1. b=m+1 in this the value of m is substituted to 2 and then add 1 so result is 3 which is assigned to b, 2. c=b*m we have obtained the value of b is 3 and the value of variable m is substitute to 2, hence result is 6, assigned to c. read less
Comments

Engineer by profression, Tutor by passion

A macro is a name given to a "block of the code" which can be substituted where the code snippet is to be used for more than once. Different ways of using macros are as follows: 1) Defining Macros without values eg- #define MACRO1. In this case we use them as testing conditions along with ifdef statements. 2)...
read more
A macro is a name given to a "block of the code" which can be substituted where the code snippet is to be used for more than once. Different ways of using macros are as follows: 1) Defining Macros without values eg- #define MACRO1. In this case we use them as testing conditions along with ifdef statements. 2) Macros with values,eg - #define MACRO1 25. In the preprocessing stage of the compilation process, the name of this macro is replaced with macros value all over the code. 3) Macros with piece of code as their values, eg - #define MACRO(i) (i*78) * (45+x) read less
Comments

View 1 more Answers

Related Questions

How and where do I start learning C programming?
Goals Fundamental concepts of C programming language. Write your first C program. Understand different keywords & Data types in C. Understand Variables & Scope of Variables. Learn Enumeration or Enum...
Krishna
0 0
5
How do I get 6 power 13 in c language?
#include <stdio.h> #include <math.h> int main() { double result = pow(6, 13); printf("6 to the power of 13 is: %f ", result); return 0; }
Raju
0 0
6
What is the best website to learn c language?
First go through the book "Let Us C" by Yashawant Kanetkar, then try to implement few small codes by your own, it takes time but you will learn it properly by experience only
Nom
What is a pragma?
In computer programming, a directive pragma is a language construct that specifies how a compiler should process its input. The ' #pragma ' directive is the method specified by the C standard for providing...
Anil
How can I develop my C language?
Developing your proficiency in the C programming language involves a combination of learning, practice, and real-world application. Here are some steps to help you enhance your skills in C: Learn the...
Himanshu
0 0
5

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

C Program-The Odd Loop Demo
/* WAP to print square value of the number entered by user using odd loop*/ //Header Files #include<stdio.h>#include<conio.h> //Main Function void main(){ char another='y'; int num,sq; //...

Pointers Concept
Every variable has a memory location and every memory location has its address defined which can be accessed using ampersand (&) operator, which denotes an address in memory. Consider the following...

Swapping variable contents using C
/* WAP to swap the content of variables using C*/ //Header files #include<stdio.h>#include<conio.h> //Main function void main(){ //Variable declaration of type integer int a,b,c; //function...

Pointers and References
Are reference and pointers same? No. I have seen this confusion crumbling up among the student from the first day. So better clear out this confusion at thevery beginning. Pointers and reference...

C Program to print Block Letter and Small Case Alphabets using C
/* WAP to print Block Letter and Small Case Alpahbets using C*/ //Hint:use ascii code(value) to print #include#include void main(){ int i; clrscr(); //Block Letters Alphabets printf("Block Letters Alphabets\n");...

Recommended Articles

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more