Program to Print all Even Numbers in an Array using Pointers.

#include<stdio.h> #include<conio.h>  main() { int a[10],n,i; printf(“enter size of the array”); scanf(“%d”, ...



#include<stdio.h>
#include<conio.h> 
main()
{
int a[10],n,i;
printf(“enter size of the array”);
scanf(“%d”, &n);
printf(“enter the elements”);
for(i=0; i
scanf(“%d”, a[i]);
printf(“even numbers are \n”);
for (i=0; i
{
if (*(a+i)%2==0)
{
printf(“%d\n”, *(a+i));
}
}
getch();
}

Related

Program for calculating Sum of Digits of a given Number

#include<stdio.h> #include<conio.h> main (  ) { int n, s,n,r ; 0; printf (“enter a number”); scanf (“%d”, &n); while (n! = 0) { r = n% 10; s = r + s; n = n/10; prin...

Write A Program for sorting of n numbers (bubble sort)

#include<stdio.h> #include<conio.h> void main ( ) { int x [100],n; i, j, temp; printf (“enter size of the array”); scanf ("%d”, & n); printf (“\n enter elements into an arra...

Write A Program for searching of an element in an array (linear search)

#include<stdio.h> #include<conio.h> void main ( ) { int x [100]; i,n, flag, key ; flag = 0; printf (“enter n value”); scanf ("%d”, & n); printf (“\n Enter elements into an ar...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item