for(i=1;i<=5;i++)
{ for(x=5;x>=i;x--)
{ printf(" ");
}
for(j=1;j<=2*i-1;j++)
{ printf("1");
}
printf("\n");
}
There are many ways you could write a routine to implement text functions. You could, for example, come up with codes.
Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.
Dont know pyramid but I have code for writting a Triangle- For i=1 to 5 For j=1 to i var= var& " *" Next var=var & vbnewline Next Msgbox var
dfgbrgffee
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.
k = f(n) = 7n
swap (int *a, int *b) { *a ^= *b; *b ^= *a; *a ^= *b; }
You achieve this by putting all the values in container that allows linear traversal, such as an array. If the array has no numbers at all, the greatest common factor is 0. if the array has one number, the greatest common factor is that number. For arrays with two or more numbers, pop the last two numbers and calculate their greatest common factor, pushing the result back onto the array. Repeat until there is only one number left in the array. That number is the greatest common factor of all the original numbers. To implement this, you will need a function that can return the greatest common factor of any two values. The following shows one way to implement this function: unsigned greatest_common_factor (unsigned a, unsigned b) { while (a!=b) a>b?a-=b:b-=a; return a; }
hi question is here, 1 1 2 1 2 3 1 2 3 4
You just wrote it in numbers.. but. 31,4207 is how you write it in numbers
Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
8798797