Using Class Static Void String Int: // Addition Program
Using Class Static Void String Int: // Addition Program
Using Class Static Void String Int: // Addition Program
.
:
using System;
class Addition // Addition Program
{
static void Main ()
{
string firstNumber,//
secondNumber;//
int
x,
//
y,
//
sum;
// !
"# $% &'
()*
//
Console.Write ("Please Enter the First Number: ");
+)% ,-.
/0
/) ) ' 1
//
firstNumber = Console.ReadLine();
"# $% &'
()*
//
Console.Write ("Please Enter the Second Number: ");
+)% ,-.
/0
/) ) ' 1
//
secondNumber = Console.ReadLine ();
'23/0
$.4. $ - 5 -1
///
x =Int32.Parse (firstNumber);
y = Int32.Parse (secondNumber);
// 67 ! / ) 5 -1
sum = x + y;
// ! / ) 89 :
Console.WriteLine ("The Sum = {0}", sum);
}// /) .- ;+ Main
} // / ) ;+
:# $
Please Enter the First Number: 15
Please Enter the Second Number: 6
The Sum = 21
+ , -.$ / 0 1
) ?
&'( ) *
F$
, Q R
0 S T U VW
/2)
@O
!
,/ 2
^:: Q
] : =>
, 6 S 1 &-b c 3 ! ; d
, * _E
@gh U ` / Q , 6
Y 2 > mk ;
n; => / 4l C 0S
! ; S 1K
float / j /): * , ! ;
& , , -.$E 6
e 5 <2 `
1 -QK ;O [0 \ Z '
$a / 2
^_ , O
i 1 1j => Wf
Q J2_ $ ^ _
, !; `
O J a M* O E ,
, &-b
^_ ' X
! ;3 c :S ( & 1 ^ : JK
v B /23 1 , /23 1
n-F ! ;
;3 } 0
z F$
J $
c 3`
M* 6
!0 w* , 2
M3Wk5 ! ; y
a ~29 ,
$ g ] M$ 3 , '\n' '$'
K ,} 0 c 31 Q
5 $K <+
Y " " z F$
^:
!;
M2*
1K @ $
U2) -.$ L
int Intger;
: # $ U ` A Q /) i ' -.$ 1 Q 1 1)
2$4
E A l$5 ,
=>
O0 w*
?? J 1@ K i2 ! ;
' 7 @
` JB;
J $ [0 \ Z
,U [ O
&
A f5 M@ &
x 4@ J
&
2 5
x = 5;
7 , 7l* 5 /7 2 J7 a x 8F_@ c : /) ( & 2 ; , x -.$E => 5 ; 5 /)
( &'
Yq -F $ 8: > q M * $K@ c 5 w* , v B / 2 ` JF 1
>
: # $ 4 ' } 0 X
firstNumber = Console.ReadLine();
17 7O
/7 2 ! 75> & /)
: D$ A l c 5 , & }. d M* ; U 1N
( & / 2N
firstNumber 1@-.$E
/2)
M2)
: $5 /2 2 8 @ # $ 4
=> <2 ; 5
Int32.Parse
&
C l /)25
x =Int32.Parse (firstNumber);
Y Q -.$E
:U
J K$ /2 $ /)
, M C l
sum = x + y;
c 75 z0;7
c 75
7& e 7 1 T
k z 43> ; ,
JF
A l@
: 1 M) $4@
x =Int32.Parse (firstNumber);
=>
x =Int32.Parse (Console.ReadLine() );
A k5 , Q -.$E
e i J
, A S !; A B!> C;D$4E 1 )
2) , * J
, U2) e \
Y U$92_ F c 5 / ! l , E
; (; -.$ A k
;@ U
{0} A ;F$5
X * , 2
?? $K$5
<OE C l@ c 5 /)
( &
;F$4@ c 5 n;3 1 Q d
; :A
V H$Bk5
e M$
M
YYYY K* F2F3 @ K*
: /2 $ /)
Console.WriteLine ("{0} + {1} = {2} ", x, y, sum);
$K
Y z0;
<7
7& , 2)
( & /2 .* -Q R)l
i7 `7 / 4l
/ 47l
, /2 @ , 2 ) M2*
7&
C l
C 7l
>
: # $ A QE B , % }
/2)
, 2)
R 4
'
4@ 2 ` 10 / 4
>
[0 \ Z JQ , Modulus
: # $ A QE B 829: !;
!; 2 /2$
1 d
U7 K @ 7 ( 7& => ^ , A E
10 % 2 = 0
Y0 F
/ 4l d
UK @ ,
Fa
K@ c 5 MF$K c 5 $
Y -b / 4l
[ V /2)
7 /72)
w* , 2 @
C l ; / M /l
&
K@ c 5 829: !; ` 829: !;
5/2 =2
2* ; /929: ! ; ` /2)
1K 2.5 &
2 @0
F$ [0 \ /.
U A k4* , , 2 @ U
X *k5
: / ! E ( & B , /2 @ , ! E
y=
( x + z) 5
3 +1
2
: / ! E ( & !f /) / $ '
@ , 2)
2 $ 2
> , /2O0 h M2)
0 42 1 ;F@ 2 $
&d
w* n0 $ z
w* n0 $ M , 2)
n;
&d
n;
w* ,
w* , 2 +
w* n0 $ M /
&d
w* , B
Y] 2
J E
z S
&d
Y ] 2 =>
=> 0 42 1 ;F@ 2 $
1 $5
/2)
w* /2)B ! z
] 2 => 0 42 1 ;F@ 2 $
;@; ' A ;
/ 4l , [
/ 4l
V
%
q +
: # $ / ! E U)$ /* KE /)
y = (x + z) * 5 /2 *3 +1
6 1 2 3 4 5
K$ c 5
, 2)
: / ! E ( v B /) $K
U@ 0 2G
y = ax2 + bx + c
:# $
y=a*x*x+b*x+c
6 1 2 4
3 5
Y n;l E , ! E / $
?? / j 0 n K* d42 ?? T
/2 2 8 @ # $ JKL
, if &
& 1K
* e ',0 l T
, .
n /)
U$ O>
, 2)
, z S A $5 U K @
D$@
U@ 0
[0 \ Z ' ;O @ , 43
: M)
if ( &
@)
829:
829: -b
> /)
>
( &
2
;
;
:, g
4$ ,g
C ;D$5 / $ /2 2 <M* `
2) A Q
[0 \ Z
; 4@ c 5 # $ A ;
)Q @
6
4$ ,g
4 x
x == y
==
x != y
!=
==
, g ,g
y1
x>y
>
>
y 1 .: x
x<y
<
<
x <= y
<=
x >= y
>=
4@
4@
.: x
x
- $ /)
* (true) 829:
Y ) nW FE /)
c 5
- $ /)
?? ;a c 5
; 1K /)
/) ; $
>:# $
K , $K
=> } l* ( false ) G B
; kh &;
S ; e
if 2 /2
/)
>
, nW F
dF$ U
w* 829:
X 0 _
K@ ;
;a
YYY n;j *
:U ` A Q
if (x == 0) ;
Console.WriteLine ( " Hello , Mistake ");
7
&
&
>
Y 829: -b 829:
?J
* Rl ;
/) 1 Q $K
,!0 > , 2G
: U 8 @ # $ A QE { } ]* l ]5 ] &H U
if ( x != 5 )
{
Console.WriteLine( " Again and Again ");
Console.WriteLine (" Hello , C#");
}
&[
?? == = ]
, 0 42 /MO '
-.E => / 2 ; 4
1 U k5 ;@0 2G
, ! 5> J
&A S
4$ / g J
M* Q
@;2$5 A 2 8$* X
// sixth Program
using System;
class Comparison
{
static void Main ()
{
int number1, //
=>
)9
number2; //
"# $% &'
()*9
//
Console.Write ("Please Enter Number One : ");
23? # 6 9
23@ AB ?- 9
//
number1 =Int32.Parse( Console.ReadLine());
' 19
$% &'
()*9
//
Console.Write ("Please Enter Number Tow : " );
23? # 6 9
23?- 9
' 19
//
number2 =Int32.Parse( Console.ReadLine ());
2) C D E 5 F GH5 -19
//
if (number1 == number2)
Console.WriteLine (number1 + " == " + number2);
if (number1 != number2)
Console.WriteLine (number1 + " != " + number2);
if (number1 > number2)
Console.WriteLine (number1 + " > " + number2);
if (number1 < number2)
Console.WriteLine (number1 + " < " + number2);
if (number1 >= number2)
Console.WriteLine (number1 + " >= " + number2);
if (number1 <= number2)
Console.WriteLine (number1 + " <= " + number2);
} // /) .- ;+
}// / ) ;+
:# $
Please Enter Number One : 3
Please Enter Number Tow : 3
3 == 3
3 =< 3
3 => 3
, O DE
YYY U 2 & , 4
Y+
7)F 7
D$@ $) O ^2 ,
|9
> A k7* ? ) ) $4 x$
) + J $4 x$ * , J2)
Y
S U2) )$ ;
7 0 J7
" y + 2 =" + y +2
~23 7 i2 " y + 2 = 52" : # $ y = 5 / 2 d
> O$
K@
: => /l 4 n L A; 2G , &
" y + 2 = " + ( y +2)
Y7 &
: # $ A QE B ! 5 J
) U M* $B
! z0;
;$5
& <$D
JF
x=6;
y = x =0;
?x
, e B 1 <) $ c 5 U2)
, n F ! O JK , ,kB ;l* x = 0
0 42 => ] 2 1 J @ M* v BS ,g E J iK J @ ! 5 J
:# $
y = ( x = 0 );
F$K
y / 2 <K*
y = 6 dFO >
U ' F5
1K @ R 4 A QE * iK i2
: / ;L* , O
^@0 _7
, g7
K ~29 /: h U$2 }2 [ 4{
$ q 1
^_ ,gB;E
K ~29 , n j ; 2 /3 4 [ 4{
I * 2(r )= M$3 47
M@ A S !; J
/ 47l
,gB;E
0 !e O X
7 J7
$ , 2 @
F9E q2
I * r * 2 = n j ; 2 Y M2 n j ; /3 4 , O DE n j ;
Y n j ; ^_ & r ~23
1 J
& Q !;
w* , 1@!; A Fl$5 C l@
$ q3
>
K !; , B J_ C l@
"OK"
Y / 4l
$ q4
: => )_ @ 42339 !; U ` A Q , , b * gQ v BS 1 / B J
4 2 3 3 9
Y / 4l
************
****
/ 4l
C;D$5