TestingDocs.com
    Software Testing website
    • Automation
      • Selenium
      • JBehave Framework
    • Tutorials
      • MySQL Tutorials
      • Testlink
      • Maven
      • Git
    • IDEs
      • IntelliJ IDEA
      • Eclipse
    • Flowcharts
      • Flowgorithm
      • Raptor
    • About

    C Tutorials

    C Variables

    Overview

    In this tutorial, we will learn about C Variables. Variable names are names that refer to computer memory locations. ( RAM: Random Access Memory). We can use simple human-readable variable names to store and access the program data. Programmers do not need to remember or use the actual memory address in order to store or retrieve data.

    C Variables

    We can store data in the variables and access them to perform calculations in the C program. Before using the variable in the C program we need to declare the variable.

    Variable declaration

    When you define a variable in a C program, we must tell the C compiler the variable name and what kind of data or data type of the variable it will hold.

    For example integer, float, double, char, bool, etc.

    Declare Single Variable

    The general syntax of the variable declaration in C is as follows:

    <data_type> <variable_name>;

     

     

    C Variable Declaration

    Examples

    int number;

    In this example, we have declared an integer variable called number. The variable can store whole numbers.

    C Variables

    Let’s declare another variable. In this example, we have declared interestRate variable of double datatype.

    double interestRate;

    double area;

    Declare Multiple Variables

    We can also declare multiple variables of the same data type using a single statement:

    double length, width, area;

    —

    C Tutorials

    C Tutorials on this website can be found at:

    https://www.testingdocs.com/c-language-tutorial/

    Related Posts

    C Language Characteristics

    C Tutorials /

    C Language Characteristics

    C Source Code .c File

    C Tutorials /

    C Program Files & Formats

    GNU Compiler Collection GCC

    C Tutorials /

    C Compilers

    C Pointers

    C Tutorials /

    C Pointers

    C Tutorials /

    C Two-Dimensional Arrays

    ‹ C Reserved Words› C Programming Environment

    Recent Posts

    • Running Tests in Parallel with Selenium Grid
    • Advanced Selenium Features
    • Locating Web Elements
    • Running the Test Script
    • Writing Your First Selenium Test Script
    • Getting Started with Selenium Automation Testing
    • Setting Up the Environment
    • How can you monitor the Quality Assurance Audit?
    • Leveraging LambdaTest with Appium 2.0
    • Appium 2.0 Plugins ListAppium 2.0 Plugins
    • Touch Actions and Multi-Touch Actions
    • Changes in Drivers and Classes
    • Appium Inspector
    • Capabilities in Appium 2.0
    • Appium 2.0 Driver ListAppium 2.0 Driver Installation & Management
    CyberLink Multimedia Software

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com