Friday, 4 March 2016

Solution of URI 1073 :: Even Square


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 a,b=0,N;
    scanf ("%d", &N);
    for(a=2;a<=N;a=a+2)
    {
        b=a*a;
        printf("%d^2 = %d\n",a,b);
        b=0;
    }
    return 0;
}

1 comment:

  1. #include
    int main(){
    int a,b,N;
    scanf ("%d", &N);
    for(a=2;a<=N;a=a+2){
    b=a*a;
    printf("%d^2 = %d\n",a,b);
    }
    return 0;}


    :D

    ReplyDelete

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