#include<stdio.h>
void main(){
int n,count=0;
printf("Enter an number ");
scanf("%d",&n);
while(n>0)
{
n=n/10;
count++;
}
printf("Number of digits %d", count);
}
Tech Programming Ideas is one of the best places on the programming for programmers. Learn coding with Tech Programming Ideas tutorials. We are covered android programming, php, yii2 framework, javascript, mysql, vb.net etc.
#include<stdio.h>
void main(){
int n,count=0;
printf("Enter an number ");
scanf("%d",&n);
while(n>0)
{
n=n/10;
count++;
}
printf("Number of digits %d", count);
}
Output
Source Code
#include<stdio.h>
void main()
{
int i,j,k,rows=7;
clrscr();
for(i=1;i<=rows;i++)
{
//print blank space
for(j=1;j<=rows;j++)
{
if((i+j)<=rows)
printf(" ");
else
printf("*");
}
printf("\n");
}
getch();
}
Video