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
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
Develop a routine to reflect an object about an arbitrarily selected plane
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.
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??
What is data _null_? ,Explain with code when u need to use it in data step programming ?
how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns
Sir... please give some important coding questions asked by product companies..
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
Write a routine to implement the polymarker function
why nlogn is the lower limit of any sort algorithm?
Cluster head selection in Wireless Sensor Network using C programming language.
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
How can you relate the function with the structure? Explain with an appropriate example.
write a simple calculator c program to perform addition, subtraction, mul and div.
#include