C and Data Structures E Balagurusamy Vice Chancellor Anna University, Chennai memorialise TO THE USER This CD-ROM contains chapter-wise program uses with mention code. These are in exonerate to those given in the text. We trust the user finds them useful in enhancing his understanding of the text and as well in developing his computer programming skills using C. INTRODUCTION This is an example for a frank successor large instruction. /************************************************************/ /* simple large instruction shift */ /************************************************************/ # pin down AND && main() { kindle a,b; a = A; b = A; } if (a AND b) printf(nSame); This is an example for a simple substitution macro. This macro has a C hightail it printf() in its body. /************************************************************/ /* simple macro substitution with function */ /************************************************************/ # find out AND && #define meat printf(nSame...) main() { char a,b; a = A; b = A; } if (a AND b) MESSAGE; This is an example for a macro with argument. It calculates the field of view of a circle. /************************************************************/ /* macro with arguments */ /************************************************************/ #define AREA(r) (3.
14 * r * r) main() { float r; printf(nEnter r : ); scanf(%f,&r); printf(nArea is : %f,AREA(r)); } 3 This is an example for a macro with arguments containing relative operators and nesting of macro. It checks whether the input value is a number or alphabet. /************************************************************/ /* macro with arguments - relational operators and nesting */ /************************************************************/ #define AND && #define ISDIGIT(a) (a >= 48 AND a > 2 gives 3 (this is 12 / 2 = 6; 6 / 2 = 3 ? one category by 2 for individually shift), whereas 13 >> 1 volition give exclusively 6 (13 / 2 = 6 ? tenfold portion is truncated)....If you fatality to captivate a full essay, couch it on our website:
Ordercustompaper.comIf you want to get a full essay, wisit our page:
write my paper
No comments:
Post a Comment