Publish your: Interview/placement Paper or an Ebook you have


SELECT YOUR BRANCH

PLACEMENT PAPERS OF




CPP Balagyruswamy : Answers

CPP Balagyruswamy : Answers



CHAPTER ONE


Program
           
main( )                                                                    
           {
/*…………printing begins………………*/ 

                printf(“I see, I remember”);

           /*………………printing ends…………………*/
           }
                       






Addition of Two Numbers
Program

/* Programm ADDITION                                line-1  */
/* Written by EBG                                   line-2  */
main()                                           /* line-3  */
{                                                /* line-4  */
           int   number;                          /* line-5  */
           float amount;                          /* line-6  */
                                                 /* line-7  */
           number = 100;                          /* line-8  */
                                                 /* line-9  */
           amount = 30.75 + 75.35;                /* line-10 */
           printf(“%d\n”,number);                 /* line-11 */
           printf(“%5.2f”,amount);                /* line-12 */
}                                                /* line-13 */



 INVESTMENT PROBLEM
Program
/*--------------------- INVESTMENT PROBLEM --------------------*/
#define PERIOD   10
#define PRINCIPAL 5000.00
/*-------------------- MAIN PROGRAM BEGINS --------------------*/
main()
{ /*------------------- DECLARATION STATEMENTS ----------------*/
     int year;
     float amount, value, inrate;
/*------------------- ASSIGNMENT STATEMENTS -------------------*/
     amount = PRINCIPAL;
     inrate =  0.11;
     year  = 0;
/*------------------ COMPUTATION STATEMENTS -------------------*/
/*--------------- COMPUTATION USING While LOOP ----------------*/
     while(year <= PERIOD)
     {     printf(“%2d          %8.2f\n”,year, amount);
           value =   amount + inrate * amount;
           year      =    year + 1;
           amount         =    value;
     }
/*----------------------- while LOOP ENDS ---------------------*/
}
/*------------------------ PROGRAM ENDS -----------------------*/

 
 




PROGRAM USING FUNCTION
Program

/*------------------- PROGRAM USING FUNCTION ------------------*/

int mul (int a, int b);      /*------- DECLARATION ------------*/        

/*-------------------- MAIN PROGRAM BEGINS --------------------*/
main ()
{
     int a, b, c;

     a = 5;
     b = 10;
     c = mul (a,b);

     printf (“multiplication of %d and %d is %d”,a,b,c);
}

/* ----------------    MAIN PROGRAM ENDS
                  MUL() FUNCTION STARTS -----------------*/

int mul (int x, int y)
int p;

p = x*y;
     {
return(p);
     }
/* -------------------- MUL () FUNCTION ENDS ------------------*/









PROGRAM USING COSINE FUNCTION

Program


/*--------------- PROGRAM USING COSINE FUNCTION -------------- */
 #include
 #define   PI      3.1416
 #define   MAX     180

 main ( )
 {

     int angle;
     float x,y;
    
     angle = 0;
     printf(“        Angle     Cos(angle)\n\n”);

     while(angle  <= MAX)
{
           x = (PI/MAX)*angle;
           y = cos(x);
           printf(“%15d %13.4f\n”, angle, y);
           angle = angle + 10;
     }
 }





Spread The Love, Share Our Article


Related Posts


Be the first to comment on "CPP Balagyruswamy : Answers"

Most Popular posts

Trending posts


About Us

Free engineering materials and courseware for all is our motto . Besides we provide free Placement Orientation and Training.
Move ahead >>>>>
Email : careerncampus@gmail.com

Publish your


Keep Yourself Updated

Get the latest posts delivered on your mail box for free. Enter your email address below and press submit

You can also keep in touch via

Subscribe via RSS Feed Subscribe via Google SMS Channel


Recent Posts

Facebook



Our Partners : link directoryWeb Directory Visit blogadda.com to discover Indian blogsAcademicsTop Blogs