Showing posts with label Program to print Place value. Show all posts
Showing posts with label Program to print Place value. Show all posts

Program to print Place value

//Program to print Place value
#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,c,d,e;
clrscr();
printf("Enter a Four Digit number ");
scanf("%d",&a);
b=a/1000;a=a%1000;b=b*1000;
c=a/100;a=a%100;c=c*100;
d=a/10;a=a%10;e=a;d=d*10;
printf("Place value of %d is=%d\nPlace value of %d is=%d\nPlace value of %d is=%d\nPlace value of %d is=%d",
b,b,c,c,d,d,e,e);

getch();
return 0;

}

To Run this Program Copy it in text editor and save as .c
Then double click on it and then it will get opened in your compiler.
Click on run.