sap abap syntax join

*&---------------------------------------------------------------------* *& Report ZABAP_SYNTAX_JOINS *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* REPORT ZABAP_SYNTAX_JOINS. types : begin of tp_mara,          matnr type mara-matnr,          mtart type mara-mtart,          maktx type makt-maktx,          werks type marc-werks,         end of tp_mara. data : gt_mara type table of tp_mara,        gs_mara type tp_mara. data : gv_matnr type mara-matnr,        gv_werks type marc-werks. select-OPTIONS : s_matnr for gv_matnr,                  s_werks for gv_werks. START-OF-SELECTION.     select a~matnr, a~mtart,            b~maktx, ...

What is Constants with Example

 Definition of Constant

constant is a value (for example: 11,20.05,"Hello World",etc.) or a variable whose value is fixed during program execution. To declare a variable as a constant C proviedes a keyword const.

syntax of constant

constant data_type variable_name=value;

Example of constant

const float PRICE=495.75;


  • It is good practice to write the constants in uppercase as shown in Example


Declaration >Explanation
  • const int MAX=1;
  •              read as "MAX is an integer which constant"
  • int const MAX=1;             
  •              read  as"MAX is a  constant integer"



  • Both are valid.

    types of constants

    types of constants
    Various Types  of Constants

    primary Constants

    1. integer Constants in C
    2. Real Constants in C
    3. Character and string constants in C
    4. Backslash character constants in C

    1. integer Constants in C

    Rules for constructing Integer constants

    • An integer constant must have at least one digit .
    • It must not have a decimal point. 
    • It can either be positive or negative.
    • No commas or blanks are allowed within an integer constant. 
    • If no sign precedes an integer constant, it is assumed to be positive.
    • The allowable range for integer constants is -32768 to 32767.
     Example . 

    • 10,-578, 5000, etc. 
    • Here we can use following data types to declare integer constant :




    int, long int, long long int, signed int, unsigned int.

    2. Real constants in C

    Rules for constructing Real constants

    • A real constant must have at least one digit.

    • It must have a decimal point.
    • It could be either positive or negative.
    • If no sign precedes an integer constant, it is assumed to be positive.
    • No commas or blanks are allowed within a real constant.

    Example

    • 10.456789
    • Here we can use following data types to declare real constant:
    float


    3. Character and string constants in C

    Rules for constructing Character constants

    • A character constant is a single alphabet, a single digit
    or a single special symbol enclosed within single quotes.
    • The maximum length of a character constant is 1 character.
    • String constants are enclosed within double quotes.

    Example

    Character Constants: 'Z', 'M', etc.
    String Constants "Kunal", "Hello", etc.

    Here we can use char data type to declare character or string constant.

    4. Backslash character constants in C

    Rules for constructing Backslash constants

    • There are some characters which have special meaning in C language.
    • These characters are preceded by backslash symbol to make use of special function of them.
    • Table is the list of special characters and their purpose.


    Backslash_character

     Meaning

    \b  Backspace
    \f Form feed
    \n Newline
    \r Return
    \t Horizontal tab
    \v Vertical tab
    \\ Backslash
    \' Single quotation mark
    \" Double quotation mark
    \? Question mark
    \0 Null character









    click the link and read this post
    you can join my Telegram group and learn C programming





    Comments

    Popular posts from this blog

    ES practical syit sem 4

    Java programming practical

    Master Linux Practical for B.Sc. IT Semester 5: Download pdf and the Comprehensive Guide

    Introduction to computer system

    Advanced Web Designing (AWD) Practical Guide for B.Sc. IT 5th Semester

    CGA practical

    Mastering Advanced Java Practical(AJT): A Step-by-Step Guide

    Coding kaise sikhe