-->
Showing posts with label Program to generate given output.. Show all posts
Showing posts with label Program to generate given output.. Show all posts

Tuesday, April 14, 2020

Program to generate given output.

//program to generate following output.
/*
10
20
19
*/

#include <iostream>//header file

using namespace std;//to handle all standard characters/functions,reserved words  used in program. we do not use in turboc++ compiler.


int main()//main function
{
    int number=10;
    cout<<number<<endl;//prints 10
    number+=10;        //increses the value by 10
    cout<<number<<endl;//prints the 10
    cout<<--number;//prints 19 using prefix decrement operator.
    return 0;
}