answersLogoWhite

0

#include<stdio.h>

main()

{

int i,j,k,n;

printf("Enter the number of lines");

scanf("%d",&n);

for(i=n;i>=0;i--)

{

for(k=n-i;k>0;k--)

{

printf(" ");

}

for(j=i-1;j>=0;j--)

{

printf("%2d",i);

}

printf("\n");

}

}

User Avatar

Wiki User

12y 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))


Flow chart to reverse digits of numbers?

ALGORITHM REVERSEINPUT (string)"STRINGLENGTH() would be a function that returns the lenght of the string"FOR (i = STRINGLENGTH(string); i >= 0; i--) BEGINDISPAY (string[i])END FOREND REVERSE


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


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.


Program for print reverse string of given number in java?

public class StringReverseExample { public static void main(String[] args) { int num=1001; int n=num, rev; while(num!=0) { int d=num%10; rev= (rev*10)+d; num=num/10; } System.uot.println(rev); } }

Related Questions

10.) A two-digit number is prime. When you reverse the digits, that number is also prime. What could the number be List three possibilities.?

Some numbers that you can get when you reverse the digits and they are still prime numbers are: 403 ÷ 13 = 31 2,701 ÷ 37 = 73 1,207 ÷ 17 = 71


Write a program that inputs four digits numbers like 1234 from user and then display it in reverse order in c language?

# include&lt;stdio.h&gt; # include&lt;conio.h&gt; void main() { int n; printf("enter the number"); scanf("%d",&amp;n); while(n&gt;0) { s=n%10; printf("%d",s); n=n/10; } getch(); }


How man odd numbers between 100 and 500 remain the same when the digits are written in reverse order?

20


Does a calculator display the exact values of all rational numbers?

No. For example, 1/3 = 0.333333333...(repeats forever). The calculator can only display finitely many digits.


What is 72 reverse the digits divide by 3?

72 reverse the digits divide by 3 = 24


How many two-digit prime numbers can you find that are still prime when you reverse the digits?

61 42 56 89


What does it mean to reverse the digits in a number?

Instead of reading the numbers from left to right (1234) read them from right to left (4321).


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))


Does a calculator display the exact values of all irrational numbers?

No. An irrational number is one that does not repeat or finish, and a calculator cannot display millions of digits like an irrational number would have.


Why is it sometimes when you add 2 numbers in scientific notation in your calculator the result is just greater of the two numbers?

This happens because the contribution of the smaller number is lost in the trailing decimal digits. Suppose you had a calculator that could display 10 digits. Suppose you tried to add 123,456.789 and 0.000 000 12 The true answer is 123,456.789 000 12 but, since you can only display 10 digits, the answer shows as 123,456.7890 which is the larger number. The exact details will depend on the number of displayed digits.


What is the largest number you can actually calculate?

There is no upper limit to numbers, there are some astronomical numbers with more digits than the universe has atoms (See Graham's number) used in math. On many calculators, the largest number it can calculate is limited by the number of digits your calculator can display. If it can display 12 digits, the largest number you can calculate on it is 999,999,999,999. The scientific calculators which support scientific notation can usually calculate numbers up to 9.999999 x 1099. Some high-tech ones can go up to 9.99999 x 10999. On the other hand, I use a professional program used to crunch numbers and the largest number it says it can express is 1.920224672692357 x 10646456887 (or 22147483296). Not that I think I would need to use such a large number any time soon.


What are the first three emirp numbers?

An emirp number is a prime number which, when you reverse the digits, produces a different prime number. Therefore, there are no single-digit emirp numbers. The first three emirp numbers are: 13, 17, 31