Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Server Side Programming Articles - Page 484 of 2650
301 Views
In this tutorial, we are going to see the Golang program to find the perimeter of a Circle. Perimeter is the total length of the boundary of any closed figure. Formula Perimeter of Circle - 2 * 22 / 7 * r r - radius of a Circle For example, the radius of a Circle is 10 cm so the perimeter of a Circle is − perimeter = 2 * 22 / 7 * 10 = 62.8571428 Finding the perimeter of a circle within the function Algorithm Step 1 − Declaring the variables for ... Read More
225 Views
In this tutorial, we are going to see the Golang program to find the Area of a Trapezium. The area is the total space covered by any closed figure. Formula Area of Trapezium - ½ * (b1 + b2) * h b1 - length of one parallel side of a Trapezium b2 - length of another parallel side of a Trapezium h - the distance between the parallel sides of a Trapezium. For example, the length of one parallel side of a Trapezium is 10 cm and the other parallel side is 8 cm, and the distance between ... Read More
196 Views
In this tutorial, we are going to see the Golang program to find the Area of a Parallelogram. The area is the total space covered by any closed figure. Formula Area of the Parallelogram - base * height b - length of the base of a Parallelogram h - length of the height of a Parallelogram For example, the length of the base of a Parallelogram is 6 cm and the length of the height of the parallelogram is 4 cm so the Area of a Parallelogram is − b = 6 cm h = 4 cm Area ... Read More
478 Views
In this tutorial, we are going to see the Golang program to find the Area of a Square. The area is the total space covered by any closed figure. Formula Area of Square - (length of a side) * (length of a side) s - length of a side of a Square For example, the length of a side of a Square is 10 cm so the Area of a Square is − Area = 10 * 10 = 100 cm^2 Finding the Area of a Square within the function Algorithm Step ... Read More
900 Views
In this tutorial, we are going to see how to find the number of vowels and consonants in a sentence in Golang. If any character lies under the set {a, e, i, o , u} then that character is a vowel. Any character that does not lie in the above set is a consonant. Explanation Suppose we have a sentence “India have twenty eight states and eight union territories”. In this sentence, the characters which are bold are the vowels. So, the total vowels are 21 and consonants are 29. Finding the count of vowels and consonants within the function ... Read More
1K+ Views
In this tutorial, we are going to see how to find the sum of Natural Numbers in Golang. To do that we have two ways one using the formula itself and the other is to use a for loop we will explore both ways in this tutorial. Formula Sum = ( N * ( N + 1))/2 N = The value of the natural number till which you want to find the sum. Explanation Let's find the sum of the first 6 natural numbers using the above formula. Sum of first 6 natural numbers = 1 + 2 + ... Read More
2K+ Views
Blade is a template engine that helps you to build your view display in laravel. It also helps you to use php code inside the template. The blade templates are saved as filename.blade.php and are stored inside resources/views/ folder. To understand the above question let us create a view calling the blade template. Example 1 Inside routes/web.php I have created the following route that is calling the view hello with data ['mymsg' => 'Welcome to Tutorialspoint']. Route::get('hello', function () { return view('hello', ['mymsg' => 'Welcome to Tutorialspoint']); }); The hello.blade.php is inside resources/views folder − {{$mymsg}} ... Read More
5K+ Views
To get all the field values from the html form you can make use of the Request class. The class Illuminate\Http\Request; has to be included in your controller. Example 1 This example shows the student registration form and it has fields like name, email, age and address. Student Form @if (count($errors) > 0) @foreach ($errors->all() as $error) {{ $error }} @endforeach @endif Student Registration Name Email Age Address The StudentController class is as follows −
3K+ Views
To validate data you can make use of the Validation class. The validation helps to validate data as well as to display error messages to the user. Example 1 In the example below the make() method is used. The first argument is the data to be validated and the second is the rule applied on the data : name. $validator = Validator::make( array('name' => 'Disha'), array('name' => 'required|min:5') ); As per the above the name assigned is Disha. As per the rule the name is mandatory and the minimum characters required is 5. ... Read More
3K+ Views
To validate data you can make use of the Validation class. The validation helps to validate data as well as to display error messages to the user. To get the exact words to validate you can make use of Rule::in method available with laravel. Using Rule::in method whatever the values provided by this rule has to be matched otherwise it will fail. Example 1 working with Rule::in method To work with Rule::in method you need to include the class : use Illuminate\Validation\Rule; or use Rule; $input = [ 'category' => ['ABC', 'XYZ'], ]; Validator::make($input, [ ... Read More