[ create a new paste ] login | about

Link: http://codepad.org/EmizTt0M    [ raw code | output | fork ]

Rituparnadatta - C, pasted on Sep 19:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//loop and display odd number //
#include<stdio.h>
int main ()
{
int i;
printf("Display odd number and even :\n");
for(i=135; i<=150; i=i+1)
{
if(i%2==1)
{
printf("The odd: %5d\n",i);
}
if(i%2==0)
{
printf("the even: %d\n",i);
}
}
return 0;
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Display odd number and even :
The odd:   135
the even: 136
The odd:   137
the even: 138
The odd:   139
the even: 140
The odd:   141
the even: 142
The odd:   143
the even: 144
The odd:   145
the even: 146
The odd:   147
the even: 148
The odd:   149
the even: 150


Create a new paste based on this one


Comments: