Logo 
Search:

Assembly Language Forum

Ask Question   UnAnswered
Home » Forum » Assembly Language       RSS Feeds

odd number

  Asked By: Rashmi Prava    Date: Mar 18    Category: Assembly Language    Views: 2069
  

Write a program to display the odd number between 50 to 1

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Rehan Saiyad     Answered On: Mar 27

/*Sorry it is a C lnguage code*/
/*It works in only ubuntu
you have to insert conio.h and getch()*/

#include<stdio.h>
void main()
{
int i;
printf("Odd numbers are :\n");
for(i=50;i>0;i--)
{

if(i%2!=0) //if (number%2) then it is odd number.
printf("%d\t",i);
}
}

 
Didn't find what you were looking for? Find more on odd number Or get search suggestion and latest updates.




Tagged: