Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-02-2010
Member
 
Join Date: Jul 2006
Posts: 442
What are the Operators and Expressions in C# ?

Hello friends,
I have recently started doing the C#. Before that I learnt C and C++ programming language. I think that the logic of the operators and expressions in C# should be same as the C and C++ programming language. But I am not confirmed about that.!! Please tell me what are the Operators and Expressions in C# .?? If you provide me the coding for the same, it would be easy for me to understand.!!
__________________
"When they give you ruled paper, write the other way..." J.R.J.
Reply With Quote
  #2  
Old 09-02-2010
Member
 
Join Date: Nov 2008
Posts: 996
Re: What are the Operators and Expressions in C# ?

A sequence of one or more operands and zero or more operators is an expression. This expression can be evaluated to a single value, object, method, or namespace. A method invocation, a literal value, an operator can be included in the expressions. Simple names can be the name of a variable, type member, method parameter, namespace or type. The expression can range from simple to very complex. Operators that are used in expressions can use the other expressions as parameters. Hope that you got what is expressions.!!
Reply With Quote
  #3  
Old 09-02-2010
Member
 
Join Date: Mar 2008
Posts: 349
Re: What are the Operators and Expressions in C# ?

The primary expression operators are important category of operators. The following are the list of the expressions that are commonly used :
  • (x) - This form of the parenthesis operator is used to control precedence, either in mathematical operations or in method calls.
  • x.y - The "dot" operator is used to specify a member of a class or structure where x represents the containing entity and y represents the member.
  • a[x] - Square brackets are used to index into an array.
  • f(x) - This form of the parenthesis operator is used to list the arguments to a method.
Reply With Quote
  #4  
Old 09-02-2010
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: What are the Operators and Expressions in C# ?

An operator, two operands and an assignment makes the basic expression. I have given you an example of expression, so that it would be easy for you to understand, what is an expression :
Code:
int Sum = 10 + 20;
In the above example, that I have mentioned, consists of the (+) operator which is used to add two operands (10 and 20) together. The assignment operator (=) subsequently assigns the result of the addition to an integer variable named Sum.
Reply With Quote
  #5  
Old 09-02-2010
Member
 
Join Date: May 2008
Posts: 2,293
Re: What are the Operators and Expressions in C# ?

Like C and C++, C# also provides a range of operators for the purpose of creating mathematical expressions. The following operator can be used in C# :
[TABLE="2"]* Multiplication
/ Division
+ Addition
- Subtraction
% Modulo[/TABLE]
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What are the Operators and Expressions in C# ?"
Thread Thread Starter Forum Replies Last Post
What are an expressions used in python? Atsushi Software Development 4 31-12-2010 12:46 AM
What are an Expressions in PHP? michaels Software Development 5 05-03-2010 05:44 AM
Question on regular expressions Logan 2 Software Development 5 12-02-2010 04:21 AM
Regular Expressions in Java Ash maker Software Development 5 03-02-2010 04:42 AM
What are the Elements of Coldfusion Expressions Demetrius Software Development 3 30-03-2009 10:57 AM


All times are GMT +5.5. The time now is 08:20 AM.