C program for Selection Sort

Write a C Program For Selection Sort  C program for Selection Sort: In Selection sort, the smallest element is exchanged with the first element of the unsorted list of elements (the exchanged element takes the place where the smallest element is initially placed). Then the second smallest element is exchanged with the second element of … Read more

Operating System Important Question with Answer

 Operating System Top 10 Question with Answer Interviewer can ask (Randomly) Que. What is deadlock? Discuss the necessary condition for deadlock. Ans. Deadlock is a situation where a set of processes are blocked because each process is holding a resources acquired by some other process. The necessary condition for deadlock are as follows: Mutual Exclusion: … Read more

Write a C program for Calculator

Write a C program for Calculator #include<stdio.h> main() { char choice; float num1,num2,result; int flag=1; printf(“Enter +,-,/,* for knowing the resultn”); scanf(“%c”,&choice); printf(“Enter the number 1n”); scanf(“%f”,&num1); printf(“Enter number 2n); scanf(“%f”,&num2); switch(choice) { case ‘+’: result=num1+num2; break; case ‘-‘: result=num1-num2; break; case ‘/’: { if(num==2) { flag=0; } else { result=num1/num2; } break; } case … Read more

Write a C program to find a Sum of Series 1+1/2+1/3+1/4….+1/N

Write a C program to find a Sum of Series 1+1/2+1/3+1/4….+1/N #include <stdio.h> #include <conio.h> main() {   int number;    float sum=0.0, number1, number2;    clrscr();    printf(“n Enter the value of number: “);    scanf (“%d”, &number);    for(number2=1.0;number2<=number;number2++)    {       number1=1/number2;        sum = sum +number1;    }    printf(“n The … Read more