-
-
Save Rajssss/c75241b9ac20866ddb592560886c29fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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