Friday, 10 December 2021

format specifiers, constants, escape, comments

 # include <stdio.h>

// # define b=4.555
int main()
{
    int a=6;
    float b=4.555;
    // float b=4.0;can't be true because b is a constant & b=4.555

    // format specifier tells our compilor that what type is the formet of our
input or output variable,
    // it tells our compilor what type of varible we are using as input and output.
    // printf("%N.nDATA_type_symbol",identity like:_a,b...)
    // here N is the total space we want to alot for the corresponing variable
identity.
    // and n dikhta he ki decimal ke bad kitna space create karna he.
    // sign of N, if the sign is positive then space aage dena he & if negetive
then piche space dena he.
    // importet formet specifiers are %c:_character, %d:_integer,
%f:_float(floating number), %s:_string
    // less importent are %lf:_double integer(combination of integer+float),
%i:_unsigned integer, %l:_long integer
   
    // constants are tokens we can't change in a c programme like :_0,13, code
with harry,hemansh etc.
    // there are two way to define a constant
    // const keyword
    // #define (preprocessor)

    // escape sequance :_ "string litteral\n" here \n is escape sequance
    // it doesn't represents itself when used.
    // \n is used to move to the next line.
    // e.s always starts with a "\".

    // commant ye jo upar sab bate as notes likhi he yahi commants he.
represented by "//"
    // commants ko preprocessing me hi compilor hata deta he.
    // "/*" &"*/" ae multiline comments to comment out multiple lines.
   
    printf ("my backslash is \n ");

    printf ("my backslash is \\n ");
   
    printf("tab character\t\t");
    // to create a tab space in output

    printf("tab sound \a");

    printf("%f\n", b);

    printf("%5d\n",a);


    return 0 ;
}

No comments:

Post a Comment

here we are to help you.you can watch videos and get information about :- (1) scientific facts (2) education (3) gaming (4) music (5) lyrics (6) cartoons and many more.So keep watching keep learning, thank you.

Recurtions

  //Why are recursions? //We can solve difficult long iteratively can be solved simply recursively. // there are some problems which suite...