What is the difference between declaring a variable by
constant keyword and #define ing that variable?



What is the difference between declaring a variable by constant keyword and #define ing that varia..

Answer / ganesh

constant- it cannot be changed
# define - it can be changed if we can redefine

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Interview Questions

consider the following C code main() { int i=3,x; while(i>0) { x=func(i); i--; } int func(int n) { static sum=0; sum=sum+n; return(sum); } the final value of x is

4 Answers   TCS,


what is the difference between these initializations? Char a[]=”string”; Char *p=”literal”; Does *p++ increment p, or what it points to?

4 Answers  


we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

0 Answers  


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

0 Answers  


f(x,y,z) { y = y+1; z = z+x; } main() { int a,b; a = 2 b = 2; f(a+b,a,a); print a; } what is the value of 'a' printed

5 Answers  






write a string copy function routine?

2 Answers  


What are register variables? What are the advantage of using register variables?

0 Answers   TISL,


find the output of the following program main() { int x=5, *p; p=&x; printf("%d",++*p); }

10 Answers   Amdocs, TCS,


#include<conio.h> #include<stdio.h> void main() { int i; if(1,0,2,3) { printf("if"); } else { printf("else"); } getch(); } Can any body tell the answer of this question with explanation?

3 Answers   Huawei,


How many loops are there in c?

0 Answers  


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

0 Answers  


Print all numbers which has a certain digit in a certain position eg: number=45687 1 number=4 2 number=5 etc

4 Answers  


Categories