answersLogoWhite

0


Best Answer

# Ruby code

print 'Enter n: '; n = gets.to_i

n.times { | i |

puts ( i + 1 ) ** 2 if ( i + 1 ) % 3.0 == 0.0

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

maa ki aank

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to accept any number n print the qube of all the number from 1 to n that are divisible by 3?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a c program to accept a numbers and generate square root cube and exponential values?

write a c program to accept a number and generate a square root cube and exponential values


How do you write a program to test if a given number is divisible by 6 in C programming?

if ( x % 6 == 0 ){ printf( "%d is divisible by 6", x ); } else { printf( "%d is not divisible by 6", x ); }


Write a program to find the number of and sum of all integers greater than 100 and less than 200 that are divisible by 77?

What for? There is only a 154 inside that is divisible by 77...


How do you write c program to test that an integer number is divisible by 2?

int isDivisibleByTwo(int N) return N % 2 == 0;


Writes a c program to find the sum of all integers between 1 and n?

Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11


Program for print prime all number from 1 to 100 in foxpro?

Prime numbers are numbers that are only divisible by themselves and the number 1. You can write a program to print all prime numbers from 1 to 100 in FoxPro.


A number is divisible by 4 if the last two digits are divisible by 4 write yes on the line if the number 324 is divisible by 4 and no if it is not?

Yes.


How do you write BASIC program to accept variables?

dim a input a


Can you write a number that is divisible by 6 but not 3?

15


Write a program to accept 2 numbers and tell whether the product of the two number is equal to or greater than 1000?

C programm


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


How to write a program to accept the user name and password and then shop this is your Password?

you cant