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
operators |
- An operator 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
- Based 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(-), multiplication(*), and division(/) that gives the quotient, Modulus(%) is also called modular division gives remainder.
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:");
}
- 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.
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);
}
#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
Post a Comment