-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathif_else.c
37 lines (36 loc) · 871 Bytes
/
if_else.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <stdio.h>
#include <stdlib.h>
int main()
{ /*
int score;
printf("Score: ");
scanf("%d",&score);
if(score>=60){
printf("Congratulations you passed the exam \n");
printf("Your score: %d\n\n",score);
}
else{
printf("Unfortunately you did not pass the exam\n");
printf("Your score: %d\n\n",score);
}
printf("The program continues to run \n\n");
*/
int myNumber;
printf("enter a number: ");
scanf("%d",&myNumber);
if (myNumber>0)
{
printf("The value is positive");
}
else if(myNumber<0)
{
printf("The value is negative");
}
else
printf("Your number is 0");
/*
Kısayol şart oluşturma
(myNumber>0) ?(ise şartı bu) printf("your number is positive") :(else şartı bu) printf("your number is negative");
*/
return 0;
}