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

What is a local block in C programming?
the statements within the braces { } is known as local block
Rakhi
0 0
6
What are the main characteristics of c programming?
C programming is characterized by several key features that contribute to its popularity and versatility. Here are some of the main characteristics of the C programming language: Procedural Programming: ...
Balendra
0 0
6
Is it necessary for a programmer to start his career by learning the C language first?
no, but c is the basic if u have good analysing skills need to learn if u learn c , you can easy to get the c++ else u have put some effort on this session f c++
Shilpa
What is a calling function in C?
A calling function is a way to execute a block of code that's defined elsewhere in your program. It's like asking a specialized worker to perform a specific task within your main project. It promotes code organization, reusability, and modularity.
Deepika
0 0
6
What is the output of the below: int x, y; printf("%d", scanf("%d %d", &x, &Y));
:) Good one. It checks my eye sight. This piece of code would result in an error: "undefined symbol Y". Note: 'scanf( )' not only scans and loads the values entered by users into variables, but it...
Pravalika

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

Ask a Question

Related Lessons

INTRODUCTION TO PROGRAMMING LANGUAGES
Language is a medium for communication. If we want to perform anything with another person, we can know the human language as a human being. Similarly, if we want to perform anything with a computer, we...

Introduction to Programming Languages
What is a Programming Language? A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages...

Tips of learning Java Language/Other Programming Languages
1.You should know the basic concept: If we talk about programming languages so basic concept are same in all the high level languages. So you should know the basic concept firstly then you can easily understand...
I

ICreative Solution

0 0
0

Why we need to learn Programming languages?
Language is medium for communication. If two parties like to communicate or exchange the thoughts they must know a language. Language should be understandable by both the Parties. For example A wants to...

Pro learners tip for C language
First get the concept of algorithm before heading to write your first program.

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