TCCI-Tririd Computer Coaching Institute is focused on providing Quality education with practical sessions.Satisfaction of our student is our priority. We pride ourselves for providing proficient IT solutions. We have a highly qualificated and expereinced faculties, who, not only handle teaching, but also aspire to provide the best possible solution through their technical expertise.
Showing posts with label Learn C Programming. Show all posts
Showing posts with label Learn C Programming. Show all posts
Friday, February 28, 2020
Sunday, February 23, 2020
Operators in C - tccicomputercoaching.com
What is operator?
Operator means simple symbol which is used between operands (variable) duringmathematical process.
There are following categories:
1. arithmetic: + - * / %
i.e.
a=6b=2
printf("a+b =%d", a+b);
printf("a-b =%d", a-b);
printf("a/b =%d", a/b);
printf("a*b =%d", a*b);
printf("a%b =%d", a%b);
op:
a+b =8
a-b =4
a/b =3
a*b =12
a%b =0
Modulor Operator - % is used in Coding like ro find Number is even or Odd.
if(a%2==0)
{
printf("a is even");
}
else
{
printf("a is odd");
}
2. relational operator : > >= < <= == !=
For example,a=6
b=2;
if(a==b)
{
printf("a and b are same");
}
else
{
printf("a and b are not same");
}
3. logical operator : && || !
&& ||-----------------------------------------------------------------------------------------------------------------
c.1 c.2 Result c.1 c.2 Result
-----------------------------------------------------------------------------------------------------------------
1. T T T T T T
2. F T F F T t
3. T F F T F t
4. F F F F F F4. Assignment Operator: =
This operator assign value of right side variable to the left sidevariable.
i.e int x=10,y=20 ;
printf("%d",x);
x=y;
printf("%d",x);
op:
10 20
5. Increment and decrement: ++ - -
Increment ++ and decrement -- to change the value of an operand (constant or variable) by 1. Increment ++ increases the value by 1 whereas decrement -- decreases the value by 1. These two operators are unary operators, meaning they only operate on a single operand.i.e,
int x=6;
x++;
printf("%d",x);
x- -;
printf("%d",x);
op: 7 6
6. Conditional operator:
Syntax: exp1? exp2:exp3I.E. int x=10,y=20 ,max;
max=x>y?x:y;
printf("%d" ,max);
OP: 20
7. Shorthand Assignment Operator: += +* +/ +%
i.eint x=6;
x+=5;
This statement expnad like x=x+5;
x= 6+5;
x=11;
8. Bitwise Operators
: & | > <
The Bitwise operators is used to perform bit-level operations on the operands. The operators are first converted to bit-level and then the calculation is performed on the operands. The mathematical operations such as addition, subtraction, multiplication etc. can be performed at bit-level for faster processing. For example, the bitwise AND represented as & operator in takes two numbers as operands and does AND on every bit of two numbers. The result of AND is 1 only if both bits are 1.i.e
Assume variable 'A' holds 60 and variable 'B' holds 13, then -
(A & B) = 12, i.e., 0000 1100
For more information about C programming at TCCI
Call us @ 9825618292
Visit us @ http://tccicomputercoaching.com/
Friday, February 21, 2020
Basic Structure of C Programming - tccicomputercoaching.com
1. documentation
2. directive preprocessor
stdio.h
(printf-scanf) #include<stdio.h>
conio.h
(clrscr - getch)
3.#define (optional)
4. global declaration(optional)
5. void main()
{ ----execution start
int a,b; ------------------>1. declaration part
clrscr();
__________________>2. executable part
getch();
}----execution complete
6. userdefined fn()
{
process......
............
}
Hope this will help every learner.
For more information about C programming at TCCI
Call us @ 9825618292
Visit us @ www.tccicomputercoatching.com
Subscribe to:
Posts (Atom)

