Skip to content

Instantly share code, notes, and snippets.

@Rajssss
Created July 12, 2019 04:27
Show Gist options
  • Save Rajssss/c75241b9ac20866ddb592560886c29fa to your computer and use it in GitHub Desktop.
Save Rajssss/c75241b9ac20866ddb592560886c29fa to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main()
{
int A[10], a, b, t1=0, t2=0, count=0;
printf("Enter elements of array =>");
for(int i=0; i<10; i++)
{
scanf("%d", &A[i]);
}
printf("\nEnter A and B =>");
scanf("%d %d", &a, &b);
for(int i=0; i<10; i++)
{
if(A[i]==a)
t1=i;
else if(A[i]==b)
t2=i;
}
for(t1; t1<=t2; t1++)
{
count++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment