How To Make Text Input Field In React Native?

TextInput is React Native’s core component. It allows the user to take the input. There are many Props (properties) that make, TextInput useful for us. defaultValue : Used to show default value before value being changed by users. onChangeText : This allows the user to take a function i.e. called every […]

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 […]

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; […]

Write a program to find length and sum of digits in a number.

Lets first figure out the logic of getting digits of a number, once we get the digit we can count them and also find addition. suppose we have a digit= 543374. lets figure out it as; Step 1: reminder = 543374%10 = 4 digit =543374/10 =54337     (1 digit) Step […]

Write a program for binary searching in c

Binary search:  Binary search is less time taking than linear search as it starts in the middle of a sorted array, and determines on which side the value is. Steps for binary search algorithm: Firstly before applying direct searching on array, we have to sort the array. for sorting algorithm you […]

How to Write program for creating and writing in CSV file?

File Handling : It  is a way of performing operation on file using C language. operations are  like creation of file, writing, appending, reading and etc. Creating File: fopen() is used to open the file and it takes two arguments. First argument is the file pointer (name of file) we want to […]