Skip to main content

WHAT IS CSS?ADVANTAGES, SYNTAX.

 CSS PROGRAMMING LANGAUGE                                                                     disadvantages CSS full form is cascade style sheets , which we call it says about how you should display the HTML elements on the screen. CSS tells us the style of the webpage let us take a simple example, if we build a home first we lay out the design that is known as the HTML language. Where the CSS means layout which means giving instructions on how the furniture should be nothing but the CSS. For example if we take PayPal we can see that the background color blue says the CSS background-color property. Netflix is also the best way of saying  CSS property, but if we remove it will be a normal webpage but with the red color and the black plus symbols it looks like the best webpage. Versions of CSS There are different versions available now in case it is developed by Wium we have three versions that are css1, css2, and css3. Currently we are using this css3 version this is the best version fo

DATA TYPES IN C? PROGRAMS FOR DATA TYPE

DATA TYPES

int, float, char
different data types 



  • Data types in C specify the type of data that can be stored in computer memory and also specify the set of values and operations that can be applied to those values.
  • It also specifies the type of data that can be returned, which is a collection of data with fixed values with meaning and characteristics.

DIFFERENT DATA TYPES

  • There are different data types in the c language: The "int" data type is used to store integers, mostly non-decimal numbers for example,-34,56, etc.
  • "Float" data type is used to store decimal numbers, for eg:- 345.6,5.6,34.5, etc. "char" is used to store characters(mostly an alphabet), for eg:-A, c, a, C, j.
  • Now let us see how to write the syntax in a c program, the first step is <data type> which means the type of data that you want to store in the computer memory.
  • We need to specify the second step. Which is to give the space and then say the name of the variable that is with which variable we want to store <name of the variable> so the overall syntax will be <data type>  <name of the variable>.
  •  Int a----->Here int is the data type and a is the name of the variable
  • Float b--------> float is the data type, and b is the variable.
  • Char c--------->char data type, and c variable.
  • Note:- semicolon(;) which is the most important thing if we don't use it then it leads to compiler error.
         

FORMAT SPECIFIER:

  •  format specifier is a string, and the format string starts with the "%" character there are different format specifiers for data types which we are going to learn in this blog.
  • "int" we have the format specifier %d using this we can store only the integer type data.
  • "float"%f  by this we store the decimal values and for "char" that is the character value stores %c.
          int-%d
          float-%f
          char-%c
  • Format specifiers are used in two scenarios, that is while reading data from the keyboard into a variable, and while displaying data stored in a variable onto the console.

PROGRAMS FOR DATA TYPES 

format specifier in c

format specifier
  1. Store 25 in computer memory.
          int n;-------->1st step(declaring the variable).
          n=25; ------->2nd step(assigning the value ).
  • In this example we need to store 25 so we learned before, that to write the syntax in the above lines 25 is without a decimal point take int data type in C.
  • And then give space and write the name of the variable we have given n, and in the next step give the value to the variable that is 25.
          
      2. Store 24.7 

           float a;
           a=24.7;
  • This is similar to the previous question there is a small change. We are using the float data type in C instead of int because 24.7 is the decimal number, we are declaring variable a, and in the next step, we are assigning the value to it.
     3. Store 'a' 
           char n;
           n='a';
  • We are using the char data type because we need to store alphabet values and then declare variable n, and then assign it 'a'. 
    4. Store 56  and display it.
           int  n;-----> 1st line of code
           n=56;------>2 nd line of code
           print f("%d", n);----->3rd line of code
  •  All the previous questions were related to storing from we are going to learn, how to display it after storing so here first and second lines know but the third line needs to use print f.
  •  Within double quotes, the Int format specifier is "%d" after that write the variable which you declared and assigned the value.
   5. Store 4.5 display.
           float n;
           n=4.5;
           printf("%f", n);
  • DATA TYPES IN C, Float has been used because 4.5 is a decimal value and then a variable has been declared and the next step assigned value, displayed it using Printf by using the format specifier and then declared variable.
   6. Store 'z' display.
         char n;
         n='z';
         Printf("%c", n);
  • This is what we studied in this blog the data type in C and the format specifier in the next blogs we are going to study the programs in c language.
          

Comments

Popular posts from this blog

WHAT IS C LANGUAGE? USES, COMPILER

C LANGUAGE C language compiler, C is one of the most popular languages in programming,  Dennis M.RITCHIE invented C programming in the year the 1970s,  C is a high-level programming language which means, its instructions are away from the understanding of the processor. There is a small difference between C language and C++ that is c does not provide object-oriented support. C++ gives class-based support(ORS) which means the same as the previous line in this blog. WHY LEARN C  LANGAUGE Learning C language and a compiler will be useful for coding. Especially for making a website with C language. If we learn C++ it will be useful for making a website. This means C language is only used for making a website but C++ is used for adding colors background colors etc. C language is one of the straightforward languages means easily understandable language. USES OF C LANGUAGE While the C language is used, in the creation of hardware devices.  It is also used in the OS, that is the operating sy

OPERATORS IN C?ARITHMETIC, ASSIGNMENT....

  O PERATORS IN C                                                                  operators A n op erator is a symbol that acts on data items known as operands in order to process them.   for eg-   a+b   ( "a" and "b" are operands, and "+" is an operator ).               c-a     ( " c "&"a"  both are operands "-" operator ).    We can do addition, subtraction, multiplication, division, etc........ Operand and the operator plays a very important role in the programming language. CLASSIFICATION OF OPERATORS B ased number of operands operating upon, operators are classified into three types. Unary operators(operate upon single operand). Binary operators(operate upon two operands). Ternary operators(three operands). On the type of execution they perform on the operands, operators are classed  into six types Arithmetic operator :-arithmetic operators are the operators which perform addition( + ), subtraction( - ), multipli

FUNCTIONS IN C?CLASSIFICATION, PARAMETERS, LOCAL VARIABLE.

 WHAT IS A FUNCTION                                                                         function A self-contained, named block of code that performs the specific task when called is nothing but a function. Note:-functions are the task performers in C projects.  FUNCTIONS CLASSIFICATION We have 2 types of functions they are user-defined functions and library functions. A pre-created function that comes with C installation is nothing but a library function, For eg:- print () and scanf(). Library functions are ready-made named code blocks. We need not create them, Just use them in our programs. We can make use of this library function by making the library function available to the program and the next step is calling the library function. Our own created function which is the program-created function is nothing but a user-defined function , eg- the main function is the example of a user-defined function. BENEFITS OF USER-DEFINED FUNCTION There are many benefits of user-defined func