C Programming, C++ PROGRAMMING

INTEGER VARIABLE IN C

INTEGER VARIABLE IN C

BASICS PROGRAMMING

#include<stdoi.h>
#include<conio.h>

struct complex
{
int x,y:
};
void funval(struct complex);
void funref(struct complex);

void main()
{
          struct complex c1;
          c1.x=8; c1.y=9;
          clrscr();
          printf(“nOringnal value n”);
          printf(“n%d”,c1.x);
          printf(“n%d”,c1.y);
          funval(c1);
          printf(“nAfter value function calln”)
          printf(“n%d”,c1.x);
          printf(“n%d”,c1.y);
          funref(&c1);
          printf(“nAfter reference function calln”);                                                                              
          printf(“n%d”,c1.x);
          printf(“n%d”,c1.y);

void funval(struct complex c)
{
               c.x++;
               c.y++;
               printf(“nin  value parameter functionn”);
               printf(“x= %d”,c.x);
               printf(“ny = %d”,c.y);
 }
voidfunRef ( struct complex *c)
{     c->x++;
       c->y++;
       printf(“n In reference parameter function n”);
                          printf(“x=%d”, c->x);
                          printf(“ny=%d”, c-y);
}

AND YOUR OUTPUT IS:-
ORIGINAL VALUE
X=8
Y=9
IN VALUE PARAMETER FUNCTION
X=9
Y=10
AFTER VALUE FUNCTION CALL
X=8
Y=9
IN REFERENCE PARAMETER FUNCTION
X=9
Y=10
AFTER REFERENCE FUNCTION CALL
X=9
Y=10
                 

          

3 Comments

  1. Good day! This is my first visit to your blog! We are a group of volunteers and starting a new initiative in a community in the same niche. Your blog provided us valuable information to work on. You have done a marvellous job!

  2. hello, I am a beginner to blogging and also to building sites. I really enjoyed your website. You have great posts and thank you for sharing the information with us.

Leave a Reply

Your email address will not be published. Required fields are marked *