INLINE FUNCTION

     #include<iostream.h>
     #include<conio.h>
     //inline function
     inline int square(int n)
     {
      return(n*n);
     }
     inline int cube(int n)
     {
      return(n*n*n);
     }
     void main()
     {
      int a;
      clrscr();
      cout<<"\n\tEnter Any Number : ";
      cin>>a;
      cout<<"\n\tSquare = "<<square(a);
      cout<<"\n\tCube  = "<<cube(a);
      getch();
     }

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...