#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,l,m;
clrscr();
for(i=0;i<4;i++)
{
for(j=i+1;j<=4;j++)
{
printf("%d",j);
}
for(k=1;k<=i;k++)
{
printf("%d",k);
}
printf("\n");
for(k=i;k>=1;k--)
{
printf("%d",k);
}
for(j=4;j>=i+1;j--)
{
printf("%d",j);
}
getch();
}
#include <stdio.h> int main(int argc, char** argv){ int a,b,c,d; for(a=1; a<5; a++){ for(b=1; b<5; b++){ for(c=1; c<5; c++){ for(d=1; d<5; d++){ if(!(a==b a==c a==d b==c b==d c==d)) printf("%d%d%d%d\n",a,b,c,d); } } } } return 0; }
One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.
Using while loop, write a program which calculates the product of digits from 1 to 5 and also show these no's vertically.
public static void main(String[] args) { int val = 100; int val1 = 50; System.out.println("Number of digits in " + val + " is: " + new String(val + "").length()); System.out.println("Number of digits in " + val1 + " is: " + new String(val1 + "").length()); }
write a c++ program to convert binary number to decimal number by using while statement
write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program
no thanks
In decimal we write a number by using a combination of 10 digits (0-9). In base 2, however, numbers are written by using a combination of only 2 digits (0 & 1). We call this number system binary.
One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.
#include <stdio.h> int main(int argc, char **argv) { if (argc<1) { printf("Usage: %s number\n",argv[0]); return -1; } int digits=1, i=atoi(argv[1]); while (i/=10) ++digits; printf("%d\n",digits); }
To write the number in digits, you would write it like this: 95,032,659,004.
8,400,000.00
99
Not completely to its end. If you can completely write a number with digits, then it's a rational number.
Using while loop, write a program which calculates the product of digits from 1 to 5 and also show these no's vertically.
Write a program to convert a 2-digit BCD number into hexadecimal
Write the digits in such a way that there are six digits to the right of the number of millions, and three digits to the right of the thousands. Fill out missing digits with zeros.
100,000 your write the number followed by five zeroes