SIZ Education || Program of C++ || by @ahsansharif

in Steem Infinity Zone3 years ago

Assalam-u-Alikum!

I hope you all are well and good and enjoy a happy moments of life.
Now I am sharing C++ program. I hope this is more beneficial for IT and CS students.

image.png

So here I show you some program of C++.

(01) Find Maximum Number In a Array:

Input:

#include
using namespace std;
int main()
{
int i, a[10], max;
cout<<"please enter an array of 10 elements :";
for(i=0; i<10; i++)
{
cout<<i+1<<"please enter number :";
cin>>a[i];
}
max=a[0];
for(i=0; i<10; i++)
if(max<a[i])
max = a[i];
cout<<"the maximum number :"<<max;

return 0;

}

Output:

Find maximum Number.PNG

Divider 2.png

(02) Find Odd Numbers between Numbers:

Input:

#include
using namespace std;
int main()
{
int i,s,e;
cout<<"please enter strating value =";
cin>>s;
cout<<"please enter ending value =";
cin>>e;
for(i=2; i<=10; i++)
if(i%2==1)
cout<<i<<" ";

return 0;
}

Output:

this.PNG

Divider 2.png

(03) Find Even Numbers Between Numbers:

Input:

#include
using namespace std;
int main()
{
int i,s,e;
cout<<"please enter strating value =";
cin>>s;
cout<<"please enter ending value =";
cin>>e;
for(i=2; i<=10; i+=2)
cout<<i<<" ";

return 0;
}

Output:

is this.PNG

Divider 1.png

NOTE:

I didn't write iostream next to #include because it's an HTML symbol that doesn't post on steemit.

I hope you all are like my post.

꧁༒T🄷🄰🄽🄺🅂 🄵🄾 🅁 🅅🄸🅂🄸🅃🄸🄽🄶༒꧂

Cc:
@cryptokraze
@siz-official
@vvarishayy
@suboohi

Footer.png

Regards:@ahsansharif

Ahsan footer.png

Sort:  
 3 years ago 

Good work bro.
That's informative post.
keep it up.

 3 years ago 

Thanks a lot my friend

 3 years ago 

Nice 🙂

 3 years ago 

Thanks 😊

Good job bro
Keep it up

Coin Marketplace

STEEM 0.25
TRX 0.19
JST 0.037
BTC 94103.03
ETH 3331.64
USDT 1.00
SBD 3.90