Tech Getz

Main Menu

  • Mobile
  • Apple
  • Computer
  • Contact Us
Sign in / Join

Login

Welcome! Login in to your account
Lost your password?

Lost Password

Back to login

logo

  • Mobile
    • JIO starts 5G service in India next year:Mukesh Ambani

      12/08/2020
      0
    • Xiaomi Mi 10 pro launched with 5G

      03/29/2020
      0
    • Redmi Note 9 Pro launched Rs 14999

      03/12/2020
      0
    • RealMe 6 pro launch in India on March 5

      02/26/2020
      0
    • Vivo S1 Pro Review

      01/27/2020
      0
    • Why Android Studio for App development?

      01/23/2020
      0
    • samsung Galaxy A50 specification and review

      12/28/2019
      0
    • How to stop adding someone to Whatsapp Group

      12/24/2019
      0
    • Great Apps and Service 2019

      12/21/2019
      0
  • Apple
    • The story of Jobs and Ipod

      11/16/2020
      0
    • Jobs firing and return to Apple Inc

      10/09/2019
      0
    • Apple iPad 2018 Vs iPad 2017

      03/29/2018
      0
  • Computer
    • JIO starts 5G service in India next year:Mukesh Ambani

      12/08/2020
      0
    • How to enable WhatsApp 'Disappearing Messages' feature

      11/19/2020
      0
    • What is data Analyst and Scope?

      11/08/2020
      0
    • What is for Looping in C?

      09/29/2020
      0
    • Which is the first program language from Bill Gates

      09/20/2020
      0
    • Tiktok rival launched by Youtube

      09/16/2020
      0
    • Which is the first video Conferencing App In the World

      08/23/2020
      0
    • What are the Retan Tata's Investments in Startups

      08/13/2020
      0
    • What are Chinese Social Media Applications

      07/14/2020
      0
  • Contact Us
Computer
Home›Computer›LET US STUDY C PROGRAMMING 4 Operators

LET US STUDY C PROGRAMMING 4 Operators

By fazilmuhammed
04/26/2020
599
0
Share:

In the last section a program we are written in the program some function are used that are

clrscr() means clear screen.

getch() means get character.

printf() means printing.

scanf() means scan what we are using in the program.

Format Identifiers

%d   decimal integers

  %x  hex integer

  %c   character

  %f  float and double number

  %s  string

  %p  pointer

How to specify display space for a variable?

printf(“The student id is %5d \n”, stud_id);

The value of stud_id will occupy 5 characters space in the print-out.

Why “\n”

It introduces a new line on the terminal screen.

\a alert (bell) character \\ backslash
\b backspace \? question mark
\f formfeed \’ single quote
\n newline \” double quote
\r carriage return \000 octal number
\t horizontal tab \xhh hexadecimal number
\v vertical tab

What is operator and its duty

The operator is used for what specific activity want to run. may be logical operation or mathematical. An operator is a symbol example + this operator is used for addition and ++ for increment etc.The operators are using in c program are.

  • Arithmetic Operators
  • Relational Operators
  • Logical Operators
  • Bitwise Operators
  • Assignment Operators
  •  Increment and Decrement Operators
  • Misc Operators

 Arithmetic Operators

An arithmetic operator performs mathematical operations such as addition, subtraction, multiplication etc.

Operator Meaning of Operator
+ addition or unary plus
– subtraction or unary minus
* multiplication
/ division
% remainder after division (modulo division)

example program using operator for addition.

#include <stdio.h>

int main()
{
int a,b,c;

printf(“Enter two numbers to add\n”);
scanf(“%d%d”, &a, &b);

c = a + b;

printf(“Sum of the numbers = %d\n”, c);

}

 Relational Operators

A relational operator checks the relationship between two operands. If the relation is true, it returns 1; if the relation is false returns 0.

Operator Meaning of Operator Example
== Equal to 4 == 3 is evaluated to 0
> Greater than 6> 3 is evaluated to 1
< Less than 6< 5 is evaluated to 0
!= Not equal to 3!= 4 is evaluated to 1
>= Greater than or equal to 6>= 4 is evaluated to 1
<= Less than or equal to 6<= 4 is evaluated to 0

Logical Operators

An expression containing logical operator returns either 0 or 1 depending upon whether expression results true or false.

Operator Meaning Example
&& Logical AND. True only if all operands are true If c = 6and d = 2 then, expression ((c==6) && (d>6) equals to 0.
|| Logical OR. True only if either one operand is true If c = 7and d = 3 then, expression ((c==7) || (d>7)) equals to 1.
! Logical NOT. True only if the operand is 0 If c =7 then, expression !(c==7) equals to 0.

 Bitwise Operators

During computation, mathematical operations like: addition, subtraction, multiplication, division, etc are converted to bit-level which makes processing faster and saves power.Bitwise operators are used in C programming to perform bit-level operations.

Operators Meaning of operators
& Bitwise AND
| Bitwise OR
^ Bitwise exclusive OR
~ Bitwise complement
<< Shift left
>> Shift right

Assignment Operators

An assignment operator is used for assigning a value to a variable. The most common assignment operator is =

Operator Example Same as
= a = b a = b
+= a += b a = a+b
-= a -= b a = a-b
*= a *= b a = a*b
/= a /= b a = a/b
%= a %= b a = a%b

Increment and Decrement Operators

C programming has two operators 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.

Misc Operators ↦ sizeof & ternary

Besides the operators discussed above, there are a few other important operators  

Operator Description Example
sizeof() Returns the size of a variable. sizeof(x, where a is integer, will return 6
& Returns the address of a variable. &a; returns the actual address of the variable.
* Pointer to a variable. *a;
? : Conditional Expression. If Condition is true ? then value X : otherwise value Y
Previous Article

Best online games in the time of ...

Next Article

LET US STUDY C PROGRAMMING 5 Decision ...

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0
  • 0

Related articles More from author

  • Computer

    What is for Looping in C?

    09/29/2020
    By fazilmuhammed
  • Computer

    What are Chinese Social Media Applications

    07/14/2020
    By fazilmuhammed
  • Computer

    Walk to the world of programming I

    10/11/2019
    By fazilmuhammed
  • Computer

    82 YEAR OLD PROGRAMER

    08/08/2017
    By fazilmuhammed
  • Computer

    How to enable WhatsApp ‘Disappearing Messages’ feature

    11/19/2020
    By fazilmuhammed
  • Computer

    How to start a Python programmer III

    02/23/2020
    By fazilmuhammed

Leave a reply Cancel reply

  • Business

    What are the major investments from China in Indian startups

  • Computer

    What is Netflix?

  • Computer

    What is cryptojacking? How to prevent, detect,recover

  • Recent

  • Popular

  • Comments

  • JIO starts 5G service in India next year:Mukesh Ambani

    By fazilmuhammed
    12/08/2020
  • How to enable WhatsApp ‘Disappearing Messages’ feature

    By fazilmuhammed
    11/19/2020
  • The story of Jobs and Ipod

    By fazilmuhammed
    11/16/2020
  • What is data Analyst and Scope?

    By fazilmuhammed
    11/08/2020
  • THE UNKNOWN FACTS ABOUT FLIPKART

    By fazilmuhammed
    10/31/2020
  • OPERATING SYSTEM USERS SHARE

    By fazilmuhammed
    07/23/2017
  • WHAT IS BELUGA CAVIAR

    By fazilmuhammed
    07/23/2017
  • BEST SELLING AUTOMOBILES

    By fazilmuhammed
    07/23/2017
  • Rare Stories About Dr. APJ Abdul Kalam

    By fazilmuhammed
    07/26/2017
  • Is it coffee help you live longer?

    By fazilmuhammed
    08/02/2017

Tech News

  • ComputerMobile

    JIO starts 5G service in India next year:Mukesh Ambani

    Jio 5G service will be launch may be in June 2021 said Mukesh Ambani during his keynote at India Mobile Congress 2020.Jio developing affordable android phone. The collaboration with Google ...
  • Computer

    How to enable WhatsApp ‘Disappearing Messages’ feature

    In the new updation of Whatsapp introduced new feature is disappearing message feature. This feature is once enabled, new messages sent in the individual or group chat will disappear after ...
  • Apple

    The story of Jobs and Ipod

    Ipod is the Apple’s one of the creative productive. In the 1990s walkman is the portable music player, but it is bulky. In the time Steve Jobs things 1000 music ...
  • Computer

    What is data Analyst and Scope?

    The data analyst can do the transforming data into information. This will improve knowledge and business. Now data analysis plays a role in making decisions more scientific and helping businesses ...
  • BusinessStartup

    THE UNKNOWN FACTS ABOUT FLIPKART

    1.Flipkart is an Singaporean e-commerce company but the headquartered Singapore (legal domicile) and Operation headquarter Bangalore, Karnataka, India. 2.The company started in the year  Sachin Bansal and Binny Bansal in 2007. 3.The first ...

About Us

Contact Us


  • +919995217791
  • techyget@gmail.com
  • Recent

  • Popular

  • Comments

  • JIO starts 5G service in India next year:Mukesh Ambani

    By fazilmuhammed
    12/08/2020
  • How to enable WhatsApp ‘Disappearing Messages’ feature

    By fazilmuhammed
    11/19/2020
  • The story of Jobs and Ipod

    By fazilmuhammed
    11/16/2020
  • What is data Analyst and Scope?

    By fazilmuhammed
    11/08/2020
  • OPERATING SYSTEM USERS SHARE

    By fazilmuhammed
    07/23/2017
  • WHAT IS BELUGA CAVIAR

    By fazilmuhammed
    07/23/2017
  • BEST SELLING AUTOMOBILES

    By fazilmuhammed
    07/23/2017
  • Rare Stories About Dr. APJ Abdul Kalam

    By fazilmuhammed
    07/26/2017

Follow us

© Copyright TECHGETZ. All rights reserved.