Functions in C Language
Scss:
return type function name(parameter list)
{
// function
body
}
Python:
int max(int a, int b)
{
if (a > b)
{
return a;
}
else
{
return b;
}
}
Functions in C#:
In C#, a capability is known as a
"technique." A strategy is a block of code that plays out a
particular errand and can return a worth. Strategies can take at least zero
boundaries, and can return a solitary worth or no worth by any means.
Techniques are pronounced with a strategy signature that incorporates the
technique name, the information sorts of its boundaries, and the kind of
significant worth it returns. The fundamental sentence structure for
characterizing a strategy in C# is:
Scss
return_type MethodName(parameter_list)
{
// method
body
}
Java:
int Max(int a, int b)
{
if (a > b)
{
return a;
}
else
{
return b;
}
}
In C#, strategies can be important for a class or a struct. They can likewise be called from different strategies or from the Primary strategy, which is the passage point of a C# program.
Functions in C++:
In C++, a capability is a block of
code that plays out a particular undertaking and can return a worth.
Capabilities can take at least zero boundaries and can return a solitary worth
or no worth by any stretch of the imagination. Capabilities can be called from
different capabilities or from the principal capability, which is the section
point of a C++ program. Capabilities are proclaimed with a capability signature
that incorporates the capability name, the information sorts of its boundaries,
and the kind of significant worth it returns. The fundamental sentence
structure for characterizing a capability in C++ is:
Scss:
return_type function_name(parameter_list)
{
// function
body
}
Python:
int max(int a, int b)
{
if (a > b)
{
return a;
}
else
{
return b;
}
}
In C++, capabilities can be
characterized inside or beyond a class. Capabilities can likewise be
over-burden, and that implies that various capabilities with a similar name can
be characterized with various boundary records. This considers various capabilities
to play out similar assignment in various ways, in light of the sort or number
of contentions passed to them.
Loops in C language:
In C, there are three fundamental
sorts of circles utilized for tedious execution of a block of code:
for circle: Utilized for an
unmistakable number of emphases. The punctuation is:
scss
for (instatement; condition;
increase/decrement)
{
statement(s);
}
while Loop: Executes a block of
code over and over as long as the condition is valid. The grammar is:
scss
while (condition)
{
statement(s);
}
do-while Loop: Like while circle,
however the block of code is executed first, and afterward the condition is
assessed. The grammar is:
scss
do
{
statement(s);
}
while (condition);
Data types In C/C#/C++:
·
C language upholds a few underlying information
types:
·
int: Whole number sort, used to store entire
numbers.
·
float: Drifting point type, used to store
decimal numbers.
·
double: Twofold accuracy drifting point type,
used to store decimal numbers with higher accuracy.
·
char: Character type, used to store single
characters.
·
void: Determines an unfilled worth, utilized in
capability return type to demonstrate that the capability doesn't return a
worth.
·
short: Short whole number sort, used to store
little whole number qualities.
·
long: Long number sort, used to store enormous
number qualities.
·
sign and unsigned: Used to adjust the default
stockpiling sort of int, short, and long to either marked or unsigned.
·
_Bool: Boolean sort, used to store consistent
qualities (valid or bogus).
·
_Complex: Complex number sort, used to store
complex numbers.
Data type in C#:
·
bool: Boolean sort, used to store valid or
misleading qualities.
·
byte: Unsigned 8-cycle whole number sort, used
to store little certain number qualities.
·
sbyte: Marked 8-bit whole number sort, used to
store little whole number qualities.
·
char : Unicode character type, used to store a
solitary person.
·
decimal: Decimal sort, used to store decimal
numbers with high accuracy.
·
double: Twofold accuracy drifting point type,
used to store decimal numbers with high accuracy.
·
float: Single-accuracy drifting point type, used
to store decimal numbers.
·
int: 32-bit marked whole number sort, used to
store entire numbers.
·
uint: 32-cycle unsigned number sort, used to
store positive entire numbers.
·
long: 64-digit marked number sort, used to store
huge entire numbers.
·
ulong: 64-cycle unsigned whole number sort, used
to store enormous positive entire numbers.
·
object: Base class for all information types in
C#, used to store a reference to any object.
·
short: 16-digit marked number sort, used to
store little entire numbers.
·
ushort: 16-cycle unsigned number sort, used to
store little certain entire numbers.
·
string: String type, used to store groupings of
characters.
Data type in C++:
·
bool: Boolean sort, used to store valid or
misleading qualities.
·
char: Character type, used to store a solitary
person.
·
int: Number sort, used to store entire numbers.
·
float: Drifting point type, used to store
decimal numbers.
·
double: Twofold accuracy drifting point type,
used to store decimal numbers with higher accuracy.
·
void: Determines an unfilled worth, utilized in
capability return type to demonstrate that the capability doesn't return a
worth.
·
wchar_t: Wide person type, used to store wide
characters.
·
short: Short number sort, used to store little
number qualities.
·
long: Long number sort, used to store huge
number qualities.
·
long long: Broadened number sort, used to store
considerably bigger number qualities.
·
signed and unsigned: Used to alter the default
stockpiling kind of int, short, and long to either marked or unsigned.
C++ likewise upholds client
characterized information types, for example, struct, enum, and class.



0 Comments
Please do not enter any spam link in the comment box.