Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

list odd number between 1 and 100

+1 vote
asked Nov 6, 2019 by yehualashet belayneh

5 Answers

+1 vote
answered Nov 6, 2019 by SREERENUSANKAR V (230 points)
void main()

{

int i;

for(i=1;i<=100;i+=2)

{cout<<i<<endl;}

}
commented Nov 6, 2019 by Ganesh
#include<stdio.h>
int main()
{
    int i;
    for(i=0;i<=100;i++)
    if(i%2!=0)
    printf("%d\n",i);
    return 0;
   
}
commented Nov 8, 2019 by anonymous
Dude mine is  a quicker method. Have a close look.!!
0 votes
answered Nov 7, 2019 by dheeraj (1,090 points)
a=int(input('enter the number upto odd number  u want:'))                                       by python
for i in range(a+1):
    if i%2==1:
        print(i,end='')
    print()

output

enter the number upto odd number u want:100

1

3

5

7

9

11

13

15

17

19

21

23

25

27

29

31

33

35

37

39

41

43

45

47

49

51

53

55

57

59

61

63

65

67

69

71

73

75

77

79

81

83

85

87

89

91

93

95

97

99
0 votes
answered Nov 7, 2019 by gameforcer (2,990 points)

for i in range(1, 101):
    if i % 2:
        print(i)

0 votes
answered Nov 7, 2019 by anonymous
#include <iostream>

using namespace std;
int main()
{
    
    for(int i=1;i<=100;i++)
    
       if(i%2!=0)
       cout<<"\n"<<i;
       return 0;
}
0 votes
answered Nov 10, 2019 by RAKESHMADDI (180 points)
int main()

{

int a;

scanf("%d",&a);

for(int i=0;i<a;i++)

{

if(i%2!=0)

{
printf("%d",i);

}

}

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...