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 differen...

OPERATORS IN C?ARITHMETIC, ASSIGNMENT....

 OPERATORS IN C

                                                                
operators



  • An operator is a symbol that acts on data items known as operands in order to process them.
  1.   for eg-  a+b  ("a" and "b" are operands, and "+" is an operator).
  2.               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

  • Based number of operands operating upon, operators are classified into three types.
  1. Unary operators(operate upon single operand).
  1. Binary operators(operate upon two operands).
  1. Ternary operators(three operands).
  • On the type of execution they perform on the operands, operators are classed  into six types
  1. Arithmetic operator:-arithmetic operators are the operators which perform addition(+), subtraction(-), multiplication(*), and division(/) that gives the quotient, Modulus(%) is also called modular division gives remainder.
#include<stdio.h>
void main()
{
  int a=10;
  int b=20;
  int c=15;
  int d;
  d=a+b;
  printf("the output is:");
  d=a-b;
  printf("d");
  d=a*b;
  printf("the multiplication is d:");
}
   

  1. The assignment operator that assigns a value to a variable, is nothing but an assignment operator in the assignment only we have further two classifications that are.
        simple assignment operator:- "=" represents the simple assignment operator it means,
        eg- a=10 in this we see that the value 10 is being assigned a.

        The compound assignment operator first performs the arithmetic operation and then assigns the result to a variable, it performs +=,-=,*=,/=,%= is the compound assignment operator in c.
  • In this assignment operator first operates and performs the task and then the resultant value, is been assigned to the variable for eg- a=a+2  this value is an added value being, assigned to a which is nothing but the assignment operator.
#include<stdio.h>
void main()
{
  int e=2,f;
  e=f;
  printf("e=%d\n",e);
  e+=f;
  printf("e=%d\n",e);
  e-=f;
  printf("e=%d\n",e);
}


    3. A relational/Comparison operator that is used to compare two operands for their equality, inequality, smaller, largeness, etc... is known as a comparison operator.
#include<stdio.h>
void main()
{
int a=10, b=20, c=15;
printf("%d==%d , a, b, a==b);
printf("%d>%d, a, b, a>b);
printf("%d<=%d, b, c, b<=c);
}
  • Comparision operators are known as relational operators in C  and it return True/False after comparing two values in c language 0 represents false &1 says true.
  • It is further classified into six categories equality operator, inequality operator, greater than, less than the operator, less than or equal, and greater than or equal.

INCREMENT/DECREMENT OPERATOR

  •  Increment(++):-It increases the value of the operand by 1 for eg-int a=10;
                                                                                                            a++;  
                                                                                                            print("%d",a)
  • In this example, see that an int data type is created a variable named  a++ denotes that the value of a which is 10 will be incremented that is 11, and printing it on the console we use printf and the format specifier of int is %d.
    
       Decrement(--):-It decreases value of the operand  eg-int b=25;
                                                                                                         b--;
                                                                                                         printf("%d",b);
  •  int data type created and b variable with assigning the value 25 to it decremented (--).

#include<stdio.h>
void main()
{
 int a=10,b=25;
 printf("++a=%d\n",++a);
 printf("b--=%d\n",b--);
}

PRE-INCREMENTATION:-First incrementation is performed and then the resultant value is assigned to the variable.
         int a;-->1st line of code
                  int b=12;------>2nd line  code
 a=++b;--->3rd line 
         printf("%d",a);----->4th 
     printf("%d",b);----5th
  • The first line of code int data type has been declared and the variable a,2nd line is the same as the previous line only the difference has assigned the value 12 to it a=b++.
  • The b value is 12 the value is incremented by 13 and it is assigned to the next steps they have printed it using the printf library function and using format specifier.

POST-INCREMENTATION:- First assignment is performed before incrementation after an assignment is  performed incrementation is performed

int a;
int b=12;
a=b++;
printf("%d",a);
printf("%d",b);

    Note:-b++ means post incrementation and ++b pre incrementation.

                                              




              
                   


Comments

Popular posts from this blog

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 differen...

WHAT IS HTML?HEADING TAGS

 WHAT IS HTML?                                                                 HTML  stands for hypertext markup language this is the full form of HTML. HTML is an important markup language for creating web pages. If we see any website then click the link we go to another page which is known as the web page,           combination of these web pages is known as a websit e . It is known by the name html because it is used to make the content in it more presentable. The first line of any html code is <!doctype> which is the most important step we could say. Tin Berners Lee has created the HTML programming language, and version 4.0 has become the most popular one. BASIC PROGRAM IN HTML <html> <head> <title>page title</title> <body> <h1>hi</h1> </bod...

HTML STYLES?FONT SIZE,BACKGROUND COLOUR

 HTML STYLES                                                                  background colour In HTML  have different styles like background color, font size, text color, and text alignment in this blog we are going to study different HTML styles. HTML styles that are used to change or else change whatever existing HTML tags. We have different types of styles internal styling, which is nothing but using this inside the html element. Internal means utilizing it in the head section of the HTML code, external is to apply it externally to the CSS file. BACKGROUND COLOUR We will use background color as a style in HTML for webpages to give color to the web pages of different colors like blue, red, black, etc. and there will be a syntax for giving background color. <body style="background-color: green;"> This is...