.


:




:

































 

 

 

 


Void main;




{int i

i:=43

print(' i ') }

2

.

ifelse, -, , .

2.1 , .

#include<stdio.h>

#include<conio.h>

Void main()

{clrscr();

Int n;

puts(" :");

scanf("%d",&n);

if(n%2==0) printf(" %d ", n);

else printf(" %d ", n);

puts("\nPress any key..."); getch();}

2.1

, .

1. , 100 .

2. , 20 .

3. , 3 .

4. , 0 .

5. , 5 .

2.2 , .

#include<stdio.h>

#include<conio.h>

Void main()

{clrscr();

Float x;

puts(" :");

scanf("%f",&x);

if(x>0)

if(x>100)

printf(" %.2f 100\n",x);

Else

printf(" %.2f 100\n",x);

Else

if(x<-100)

printf(" %.2f -100\n",x);

Else

printf(" %.2f -100\n",x);

puts("\nPress any key..."); getch(); }

2.2

, , , .

1. , , , , 25.

2. , , 5 30.

3. , 50, , 4, 3.

4. , , .

5. , , , 5, -100.

2.3 䳿 switch() break.

#include <stdio.h>

#include <conio.h>

Void main()

{clrscr();

Float a,b;

Char s;

puts(" :");

scanf("%f %f",&a,&b);

Fflush(stdin);

puts(" (-, +, *, /):");

s=getch();





:


: 2015-10-01; !; : 382 |


:

:

, .
==> ...

1741 - | 1566 -


© 2015-2024 lektsii.org - -

: 0.013 .