My Name Is Salman Masood , I am Computer Science &Amp; Maths Graduate from University of Karachi, Pakistan , Teaching Is My Passion and My Aim Is to Deliver All My Knowledge among Those Students Who Can'T Afford Tutors or Expensive Institute Fees. I Will Be Keep Sharing My All Knowledge and Information with You .... Remember Me in Your Prayers !
Tuesday, 26 December 2017
Learn C language Part 20 Search Element in array in c language
#include <stdio.h>
#include <conio.h>
main()
{
int n,i,index=-1;
int x[6]{32,54,23,66,2,1};
printf("Enter the number that u want to search in array: ");
scanf("%d",&n);
for(i=0;i<6;i++)
{
if(x[i]==n)
{
index=i;
break;
}
} //loop end....
if(index==-1)
{
printf("%d doesnot exist in array",n );
}
else
{
printf("%d is found at %d position",n,index);
}
}
Subscribe to:
Post Comments (Atom)
Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC
Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...
-
Load event: pictureBox3.Image = Image .FromFile( @"C:\Users\salman\Documents\Visual Studio 2013\Projects\WindowsFormsApplication3\W...
No comments:
Post a Comment