HTML Tutorial || Networking Assignment || Computer Full Forms || Ms-Office Shortcut Keys || Ms-Office Notes || Number System Notes || Internet Assignment
JavaScript Tutorial || CSS Tutorial || Operating System Notes || History of Computer Assignment || Netwoking Notes || Computer Fundamentals Notes

C program to Input an Array of 5 Elements and Print Only Odd Elements on Screen ?


Q:- Write a C program to Input an Array of 5 Elements and Print Only Odd Elements
        on Screen ?
            #include<stdio.h>
            #include<conio.h>
            main()
     {
int a[5],I;
clrscr();
printf(“Enter a Number =”);
for(i=0;i<5;i++)
{
scanf(“%d”,&a[i]);
}
for(i=0;i<=5;i++)
if(a[i] % 2!=0)
{
printf(“%d\n”,a[i]);
}
getch();
      }