The initial value of the radius of a circle is equal to one unit and each succeeding radius is one unit greater than the value before it. Write a program that computes the area of the circle starting with r = 1.0 to r = 5.0. Print out each radius and the corresponding area of the circle.
Write an algorithm to calculate income tax is annual income is given text as calculate followers
Objective: Write C programs which implement following page replacement policies.
a) First In First Out (FIFO)
b) Least Recently Used (LRU)
To avoid wasting processor time waiting for an active process to become unblocked. The OS will swap
one of the process out of the main memory to make room for a new process or for a process in
Ready- Suspend state. Therefore, the OS must choose which process to replace. Thus, when a page
fault occurs, the OS has to change a page to remove from memory to make room for the page that
must be brought in. If the page to be removed has been modified while in memory it must be written
to disk to bring the disk copy up to date. Replacement algorithms can affect the system's
performance.
Replace the page that has been in memory longest, is the policy applied by FIFO. Pages from memory are removed in round-robin fashion. Its advantage is it's simplicity.
#include<stdio.h>
void ex_function(int a,int b);
int main()
{
int n1,n2,r1,r2;
scanf("%d %d",&n1,&n2);
ex_function(n1,n2);
if(n1==r1 && n2==r2)
printf("True");
else
printf("False");
return 0;
}
void ex_function(int a, int b)
{
int i,n,r1=0,r2=0,rem;
for(i=1;a>0;i++){
rem=a%10;
r1=r1*10+rem;
a=a/10;
}
for(i=1;b>0;i++){
rem=b%10;
r2=r2*10+rem;
b=b/10;
}
printf("%d\n",r1);
printf("%d\n",r2);
}
Write a C program to find common divisors between two numbers in a given pair.
Write a C program to reverse the digits of a given number and add it to the original, If the sum is not a palindrome repeat this procedure.
Write a C program to find common divisors between two numbers in a given pair.
Write a C program to get all possible two digit letter combinations from a digit (1 to 9) string.
Write a C program to remove and print every third number from a list of numbers until the list becomes empty.
One large chemical company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5000 worth of chemicals in a week receives $200 plus 9% of $5000, or a total of $650. Develop a program that will prompt the user for a salesperson’s gross sales and will calculate and display that salesperson's earnings. Process one salesperson's figures at a time, use the sentinel value -1 to terminate the program. A sample input/output dialog for the program is below: