Hi everyone.... The main purpose of this Blog is to make you understand the programs in a ezee way. All programs are written as short as possible so that you could understand it easily... ENJOY CODING... Please do Comment about the blog and if any changes have to be made OR Any code you need...
Wednesday, July 6, 2011
Program to print the Factors of the given number
#include<iostream.h> #include<conio.h> void main() { clrscr(); int n=0,i=0; cout<<"Enter the number"<<endl; cin>>n; cout<<"The prime factors are"<<endl; for(i=1;i<=n;i++) { if(n%i==0) cout<<i<<endl; } getch(); }
No comments:
Post a Comment