#include<stdio.h>
#include<conio.h>
void main()
{
int x,y,z,i;
clrscr();
printf("Enter Two Numbers = ");
scanf("d%d",&x,&y);
for(i=1;i<=x*y*z;i++)
{
if(i%x==0&&i%y==0)
{
printf("LCM is %d\n",i);
break;
}
}
getch();
}
#include<stdio.h>
#include<math.h>
long gcd (long a, long b) {
long temp;
while (a != 0) {
temp = a;
a = b % a;
b = temp;
}
return abs (b);
}
long lcm (long a, long b) {
if (a==0 b==0) return 0;
return a / gcd (a, b) * b;
}
int main (void) {
long a, b;
printf ("Enter two integers:\n");
scanf ("%d%d", &a, &b);
printf ("gcd(%d, %d) = %d\n", a, b, gcd (a, b));
printf ("lcm(%d, %d) = %d\n", a, b, lcm (a, b));
return 0;
}
no
All integers belong to the set {..., -2, -1, 0, 1, 2, ...}. The absolute value of any integer results in a whole number {0, 1, 2, ...}. Adding and subtracting integers always results in an integer. Multiplying integers always results in an integer. Dividing integers can sometimes not result in an integer.
das
9 and 18
List the factors of each of the numbers in the set. Write down the numbers that appear on all the lists. Choose the largest one.
10,000 - patthaayiram50,000 - aaimbathaayiram
$n = 10*(1+10)/2;
x -=y;
The following is for F95 and later (due to the use of intrinsic SUM ): My assumptions: -Your numbers are integers -Your numbers are stored in an array -The numbers you are describing are 0-100 program findSum !I assumed integer, replace this with your data type integer, dimension(100) :: numbers integer :: sumOfNumbers !We populate an array with our numbers !Replace this with your numbers do i=1,(size(numbers)+1) numbers = i end do !We find the sum of those numbers sumOfNumbers = sum(numbers) !We write out the sum to prompt write(*,*) 'Sum is: ', sumOfNumbers end program findSum
First you will need to have some basic programming knowledge. You can use this to help make the program that is needed.
Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.
In the same way as you would write any integer.
Dim intNumber As Integer
Public Sub Swap() dim inta as integer dim intb as integer dim intc as integer inta=4 intb=5 intb=inta intc=intb inta=intc End Sub
In visual basic: Module Module1 Sub Main() Dim Inst As Integer For Inst = 0 To 100 Step 2 Console.WriteLine(Inst) Next End Sub End Module
TextBox1.Multiline = TrueDim amount As Integer = 200For index As Integer = 1 To amountTextBox1.Text = TextBox1.Text & " " & index ^ 2 & ","Next~Note: make sure you have a textbox called textbox 1
That really depends on what sort of program you are trying to build, what do you want the program to do?
write a lex program to delete space from the program