CALL BY REFERENCES SQUARE

//call by referencea
#include<stdio.h>
#include<conio.h>
void sq(int *x);
//formal arguments
void main()
{
   int n;
   clrscr();
   printf("\nEnter Any Number : ");
   scanf("%d",&n);
   sq(&n); //actual arguments
   getch();
}

void sq(int *x)
{
  int r;
  r=*x * *x;
  printf("\nSquare = %d",r);
}

No comments:

Post a Comment

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II :   1) Which of the following is the extension of Not...