You are on page 1of 1

/******************************************************************************

Welcome to GDB Online.


GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP,
Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS,
JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <stdio.h>

int main()
{
int i,j,n,c=0,output=1;
int a[10];
printf("enter the number of elements to be entered\n");
scanf("%d",&n);
printf("enter the elements\n");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}

for(i=0;i<n;i++)
{
if(a[i]==7)
{
c=i;
output=1;
for(j=c;j<n;j++)
{
output=output*a[j];
}
}
else
{
output=output*a[i];
}
}

printf("expected output\n= %d",output);

return 0;
}

You might also like