given integer number,write a program that displays the
number as follows:
First line :all digits
second line : all except the first digit
.
.
.
.
Last line : the last digit

Answer Posted / md. wasifur rahman siyam

#include<stdio.h>
#include<conio.h>
int main()
{
int n,i=0,j,k=1,x,c=0,sum=0,a[100];
printf("
enter the number:");
scanf("%d",&x);
while(x!=0){
a[i++]=x%10;
x=x/10;
c++;
}
printf("
the digits are :
");
printf(" ");
for(j=c-1;j>=0;j--){
for(i=c-k;i>=0;i--){
printf("%d",a[i]);
}
printf("
");
printf(" ");
k=k+1;
}
getch();
return 0;
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

3861


Develop a routine to reflect an object about an arbitrarily selected plane

3004


how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.

2147


write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??

4154


What is data _null_? ,Explain with code when u need to use it in data step programming ?

2829






how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

3131


Sir... please give some important coding questions asked by product companies..

1805


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2032


Write a routine to implement the polymarker function

4389


why nlogn is the lower limit of any sort algorithm?

2381


Cluster head selection in Wireless Sensor Network using C programming language.

3118


write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30

2228


How can you relate the function with the structure? Explain with an appropriate example.

2925


write a simple calculator c program to perform addition, subtraction, mul and div.

3158


#include int main(void) { int a=4, b=2; a=b<>2 ; printf("%d",a); return 0; }

1080