Odd Numbers in Array C Program

This program accepts 10 numbers from user & stored in array & find out odd number in array & print. This is a part of Mumbai University MCA Colleges C programming MCA Sem 1

#include<stdio.h>
#include<conio.h>
void main()
{            int i,a[10];
            clrscr();
            for(i=0;i<=9;i++)
            {   scanf("%d",&a[i]);

              }         printf("\n The number is odd");
                        for(i=0;i<=10;i++)
                        {
                                    if(a[i]%2!=0)
                                    {
                                                printf(" ");
                                                printf("%d",a[i]);
                                       }
                         } 
getch();
}

Hope this Program is useful to you in some sense or other. Keep on following this blog for more Mumbai University MCA College Programs. Happy Programming and Studying.

No comments:

Post a Comment