N=39714 3 9 1 7 4 9 1 7 4 1 7 4 7 4 4
#include <stdio.h>
int main()
{
long n = 39714, i=1;
for(i=10;i<n;i*=10);
for (i=i/10; n>0; i/=10)
{
printf("%d\n", n);
n%=i;
}
return 0;
}
Related Links:
- More Number Pattern Programs
- Star Pattern Programs in C
- Alphabet Pattern Programs in C
- Series Programs in C
how to print 'N' in c
ReplyDeleteprognam nt working
ReplyDelete#include
ReplyDeleteusing namespace std;
int drawpattern(int num[],int digits)
{
for (int i=0;i>n;
int temp1=n;
int temp2=n;
int num[10],k,digits=0;
while(temp1!=0)
{
temp1=temp1/10;
digits++;
}
for(int i=0;i<digits;i++){
k=temp2%10;
num[digits-i-1]=k;
temp2=temp2/10;
}
drawpattern(num,digits);
return 0;
}
works for any number you input - Arpit
#include
Delete#include
#include
int main(){
int i,j,a[5]={3,9,1,7,4};
for(i=5;i>=1;i--){
for(j=i;j>=1;j--){
printf("%d ",a[5-j]);
}
printf("\n");
}
}
Thanks for the program.It was helpful.
ReplyDeleteThe given N is N=39714, but the printed output was N=39174 instead of N=39714
ReplyDeleteplease reply me am i understood wrong or correct?
long n = 39714;
ReplyDeleteint k=1,l=0;
while (n%k != n) {
k = k * 10;
l++;
}
for (int i = 1; i <=l ; i++) {
System.out.print(n%k);
k=k/10;
System.out.println();
}
it is really helpfull
ReplyDelete#include
ReplyDeleteint main()
{
int n,i,j,h;
n=39174;
h=10000;
while(n!=1)
{
printf("%d\n",n);
n=n%h;
h=h/10;
if(n==0)
{
break;
}
}
return 0;
}
gevenAdeu-po Shannon Gulyas https://marketplace.visualstudio.com/items?itemName=9buecimelpi.Loading-Zone-gratuita
ReplyDeletecasannoipi
Bro correct it it's %ld because it long integer
ReplyDeleteWcomfepeu-ri Erik Joseph Software
ReplyDeleteprogram
click here
fastsbushotpleg