Friday 29 April 2016

Solution of URI 1175 :: Array change I


Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.

/**Bismillahir Rahmanir Rahim.**/

#include <stdio.h>
int main()
{
   int N[20], temp,i,j;
    for(i=0; i<20; i++)
        scanf("%d",&N[i]);
    for(i=0, j=19; i<10; i++, j--)
    {
        temp=N[i];
        N[i]=N[j];
        N[j]=temp;
    }
    for(i=0; i<20; i++)
        printf("N[%d] = %d\n",i,N[i]);
    return 0;
}

4 comments:

  1. 2nd for loop e 19 na hoye 10 holo keno?

    ReplyDelete
  2. Would you please explain the logic?????

    ReplyDelete
  3. যানের পিরিচিতিঃ 8-2095738 গ্রাহকের পরিচিতঃ৮-০০৩১৮৫০১৮ টোকেনঃ ৮-২৪৮১৩১৭ রেজিস্ট্রেশনঃ COMILLA-LA-12-1175 যানের বণর্নাঃ MOTOR CYCLEBAJAJ AUTO LTD.2011 চেসিস নম্বরঃ MD2JDJDZZTCE2535ইন্জিন নম্বরঃ JEGBTE44846 খালি গাড়ির ওজনঃ ১২১ টায়ারের সংখ্যাঃ ২ কেজির রংঃ লাল টায়ার সাইজঃ২.৭৫.১৭ সিসিঃ ১৩৫ আসনঃ ২ বোঝাই ওজনঃ ২৬১ মালিকানার বরনঃ PRIVATE নামঃ MAHMUD ALI HAIDER পিতার নামঃ MD GAIS UDDIN ঠিকানাঃ BARA ALAMPUR,DEBIDWAR COMILLA BANGLADESH ব্যাংকঃ NRB COMMERCIAL BANK LTD/N/A কর টাকাঃ ২৩০০

    ReplyDelete
  4. 2nd for loop a 10 keno?????explain please......

    ReplyDelete

Note: only a member of this blog may post a comment.