You are not logged in. Please login at www.codechef.com to post your questions!

×

Number of Factors

I have submitted the code for " Number of Factors" and it showing Wrong Answer. But in which reason it displaying as wrong ? Please mention where is my fault. I checked it in Visual Studio but there its Okay.

include<stdio.h>

int A[1000000]; int T=100; int main(){ while (T--){ int Result=1; int count=0; int i,N; scanf("%d",&N); for (i=0;i<N;i++){ scanf("%d",&A[i]); Result=Result*A[i]; }

for (i=1;i<=Result;i++){
    if (Result%i==0){
count++;
}
}

printf ("%d ",count);
printf("\n");
}

return 0;

}

asked 12 Sep '14, 15:29

purnima06's gravatar image

0★purnima06
1111
accept rate: 0%


please indent the code properly first and then submit your question

link

answered 12 Sep '14, 15:42

insaynasasin's gravatar image

1★insaynasasin
1054811
accept rate: 0%

include<iostream>

using namespace std; int main() { int i,n,c=0; cout<<"enter n value:"; cin>>n; for(i=1;i<=n;i++) { if(n%i==0) { c++; } } cout<<"number of factors is:"<<c<<endl; getch(); }

link

answered 12 Sep '14, 18:52

hailu1matta143's gravatar image

0★hailu1matta143
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×255
×150
×78
×30
×21
×16
×7
×1

question asked: 12 Sep '14, 15:29

question was seen: 1,099 times

last updated: 12 Sep '14, 18:52