Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

help me to divide first number with last number ,second no with n-1,so on the result must be stored in an array

0 votes
asked May 24, 2018 by anonymous
#include<stdio.h>

void main()

{

int n,i,j,k,a[25],b[24];

printf("enter the number");

scanf("%d",&n);

printf("enter the array elements");

for(i=0;i<n;i++)

{

scanf("%d",&a[i]);

}

while(i<n,j<=0)

{

i=0;

j=n-1;

if(a[i]<a[j])

{

b[k]=a[j]%a[i];

printf("%d",b[k]);

k++;

}

else

{

b[k]=a[i]%a[j];

printf("%d",b[k]);

k++;

}

i++;

j--;

}

}

1 Answer

0 votes
answered May 27, 2018 by 문건 (140 points)

#include <stdio.h>

int

main ()

{

  char na[99], d, pj, pxy;

  int i;

  printf ("j2ll llmlj2 l

5kj9?(Y/N)\n");

  scanf ("%s", &d);

  if (d == 'Y' || d == 'y')

    {

      printf

("l4k&l lk %m4 l#<l8l.(l5k 20l, lk,8 lk %)\n");

      scanf ("%s", &na);

      printf ("l1k3l lk %m4 l#<l8l.(k(:M/l,:W)\n");

      scanf ("%s", &pxy);

      for (i = 0; i <= i + 1; i++)

{

  if (pxy == "M" || pxy == "W")

    {

      break;

    }

  else if (pxy == "M" || pxy == "W")

    {

    }

}

      printf

("l'll l mm4l#<l8l.\nl l,/k'k2l,/kl /j6l/l1l'l\n");

      scanf ("%d", &d);

      if (d == "l l,")

pj = 'l l,', printf ("%s(l<)k! l l'ml(l

5kk$!", pj);

    }

  else if (d == 'N' || d == 'n')

    printf ("j2ll l"k#m)kk$.");

  else

    printf ("\'Y\', \'N\'l<k! lk %m4 l#<l8l.");

  return 0;

}

HELP ME!!

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...