Featured post

-Write C program to find even and odd number using macro

-Write C program to find even and odd number using macro #include<stdio.h> #define number(n)((n%2==0)?1:0) int main() { int num; printf("enter any number"); scanf("%d",&num); if(number(num)) printf("number is even"); else printf("number is odd"); return 0; } ***************************Output*********************** amr@amrj-virtual-machine:~$ gccevenodd.c amr@samr-virtual-machine:~$ ./a.out enter any number 2 number is evensmj@amr-virtual-machine:~$

Write a c++ program to find Maximum of Three using parameterized Constructor.

//Maximum number using parameterized constructor 

#include<iostream>
using namespace std;
class temp
{
int c;
public:
temp(int a,int b,int c)
{
if(a>b && b>c)
{
cout<<"maximum number is :"<<a;
}
else if(b>c)
{
cout<<"maximum number is "<<b;
}
else
{
cout<<"maximum number is"<<c;
}
}
};
int main()
{
int a,b,c;
cout<<"Enter the value:";
cin>>a>>b>>c;
temp obj(a,b,c);
return 0;
}

Out Put
********************************************************************

Enter the value:53
2
1
maximum number is :53
--------------------------------
Process exited after 5.656 seconds with return value 0
Press any key to continue . . .






************************************************************************

Comments

Popular posts from this blog

-Write C program to find even and odd number using macro

BCA (SCIENCE) JAVA PRACTICAL SLIPS PAGES.(JAVA) UNIVERSITY OF PUNE

How to OCR Text Extraction in Flutter Using Google ML Kit