Friend Function In CPP
To access personal data of class we use the friend function. The friend function is not the member of the class but still, we can access its members. For calling…
To access personal data of class we use the friend function. The friend function is not the member of the class but still, we can access its members. For calling…
#include<iostream.h> #include<conio.h> void main () { clrscr(); int n,i,x=0; cout << "enter any number" << endl; cin >> n; for(i=2;i<n;i++) { if(n%i==0) { x++; } } if(x==0) { cout <<…
#include<iostream.h> #include<conio.h> void main() { clrscr(); long a,b,c=1; cout << "enter any number" << endl; cin >>a; for(int i=1;i<=a;i++) { c=c*i; } cout << c << endl; getch(); } Output:…
A user is asked to enter 5 elements for searching. Then it will ask you to search that particular number. And it will display its position if the number present…