jituTechnology

jituTechnology

Write a C program to read through an array of any type. Write a C program to scan through this array to find a particular value.

/*program to scan through this array to find a particular value
programmed by:
Name: Jitendra Kumar Yadav
Roll: 10116
Date: 29 march 2011 */
#include <stdio.h>
#include <conio.h>
void main ()
{
int i,n,index;
int a[] = {1,2,3,4,5,6,7,8};
printf (“Enter a number from 1 to 8\n”);
scanf (“%d”,&n);
for (i=0;i<8;i++)
{
if (n==a[i])
index = i;
}
printf (“%d is at %d index”,n,index);
getch();
}

 

Add a comment

Comments (1)

  1. Nestor BaylesApril 4, 2012 Reply
    If you could e mail me with a few tips on how you made your website look this good, I would be thankful.

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

March 2024
S M T W T F S
 12
3456789
10111213141516
17181920212223
24252627282930
31