answersLogoWhite

0

#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();

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Continue Learning about Engineering

How write a program to input any number and display digits which are absent in given number?

To write a program that inputs a number and displays the digits absent in it, you can follow these steps: Convert the input number into a set of its digits. Create a set of all possible digits (0-9). Subtract the set of digits from the complete set to find the missing ones. Display the missing digits. Here’s a simple example in Python: number = input(&quot;Enter a number: &quot;) present_digits = set(number) all_digits = set('0123456789') missing_digits = all_digits - present_digits print(&quot;Missing digits:&quot;, ''.join(missing_digits))


How to write A Java program to print number of digits in a given number?

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.


How do you write a program in qbasic to input 64751315 to sum?

In QBASIC, you can write a simple program to input the number 64751315 and sum its digits as follows: DIM sum AS INTEGER sum = 0 INPUT &quot;Enter a number: &quot;; number FOR i = 1 TO LEN(number) sum = sum + VAL(MID$(number, i, 1)) NEXT PRINT &quot;The sum of the digits is &quot;; sum This program prompts the user to input a number, iterates through each digit, converts it to an integer, and adds it to the total sum, which is then printed out.


Using while loop write a program which calculates the product of digits from 1 to 5 and also show these nos vertically?

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 in java to enter 3 digits or more arrange the digits of the entered number in ascending order and display the result?

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()); }

Related Questions

Write a Shell program to find the sum of cube of individual digits of a number?

no thanks


How to write A Java program to print number of digits in a given number?

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.


What are base two numerals?

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.


Write a program to find the number of digits in the number?

#include &lt;stdio.h&gt; int main(int argc, char **argv) { if (argc&lt;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); }


How do you write 95billion32million659thousands4?

To write the number in digits, you would write it like this: 95,032,659,004.


What number is 8.4 million Write the number out with digits?

8,400,000.00


What is the largest number you can write with two digits?

99


Can you write out an irrational number in decimal form?

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 nos vertically?

Using while loop, write a program which calculates the product of digits from 1 to 5 and also show these no's vertically.


How do you write seventeen million eight hundred eighteen thousand seven?

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.


How do you write hundred thousands in digits?

100,000 your write the number followed by five zeroes


Write a program to convert a 2 digit BCD number into hexadecimal number?

Write a program to convert a 2-digit BCD number into hexadecimal