How to write program for Mini Max Sum in PHP?

Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly for of the five integers. Then print the respective minimum and maximum values. $arr = array(1,4,2,8,4,0); $temp_arr = array(); foreach($arr as $index => $row){     $temp_arr[] = array_sum($arr) – $arr[$index]; } sort($temp_arr); echo […]

What and how to use file handling in C?

Files : File is a collection of numbers, symbols and text placed on the disk. file can be read and modified as per the user requirement, thus file allow us to store information permanently in the disk. The file object contain all information about stream like current position, pointer to […]

How to write a program to convert a binary number to a decimal number?

#include <stdio.h> int main() {     int num, rem, digit=0, j=1;          printf(“Enter the number in binary \n”);     scanf(“%d”, &num);          while(num > 0){         rem = num%10;         digit += rem*j;         j *= 2;         num = num/10;     }          […]

Write a program to make star pattern Pyramid.

Hey Guys 🙂 , today i am going to tell you the tricks to make star pattern like pyramids. Suppose we have to make pattern like * ** *** **** So here are the steps to make pattern like this as; Step 1: count the depth or number of levels in a […]

Write a program to create table of any number.

import java.util.Scanner; public class Main {     public static void main(String[] args) {         Scanner scan = new Scanner(System.in);                  System.out.println(“Please enter a number, for which you want to write a table:”);         int number = scan.nextInt();                  for(int count=1; […]