Skip to main content

C++ Program If..else Statement Example

If..else Statement  Program C++



#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
    int b;//variable declaration
    cout<<"enter  the number :";
    cin>>b;
    // condition check
    if(b>10)
    {
        cout<<b<<"is greater than 10";
    }
    getch();
    return 0;
}

Output

Enter the number : 11
11 is greater than 10

Comments

Popular posts from this blog

Difference between px,dip,dp and sp in Android

Difference between px,dip,dp and sp in Android MEANING px   -> It stands for pixel and has a same meaning to the resolution of the screen density. it corresponds to the actual pixel in the screen. dip ->Dip and dip both are one and the same thing.It stands for density independent pixel.It is dependent on physical intensity pixel of screen. sp  It stands for scaled pixel. USAGE px It is used with the images to resize the image.used to fit the image to screen and change the size of the image.

Concatenation Of String

Concatenation Of String #include<iostream.h> #include<conio.h> #include<string.h> void main() { clrscr(); string str1="programming"; string str2="hub"; string str3; int len; str3=str1; cout<<str3; str3=str1+str2; cout<<str3<<endl; len=str3.size(); cout<<len<<endl; getch(); }