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; }
#include
ReplyDeleteint 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