This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove numbers from odd position | |
// Sample Input : [2,5,3,4,6,7,9,8] | |
// Output :[5,4,7,8] | |
void main() { | |
List inputList = [2, 5, 3, 4, 6, 7, 9, 8]; // Given List | |
List list = []; // empty list for sepearte the output | |
List removedElements = []; | |
print("Given List : $inputList\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Update the values of a list with their absolute values | |
// Sample Input : [2,-4,3,-1,23,-4,-54] | |
// Output : [2,4,3,1,23,4,54] | |
void main() { | |
absoluteList(); | |
} | |
void absoluteList() { | |
List<int> nonAbsuolute = [2, -4, 3, -1, 23, -4, -54]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You are given a string, str, of length N consisting of lowercase letters of alphabet. You have | |
// to remove all those characters from str which have already appeared in it, i.e., you have to | |
// keep only first occurrence of each letter. | |
// Sample Input : ccbabacc | |
// Output : cba | |
void main() { | |
removeDuplicateChar(); | |
removeDuplicateChar2(); | |
removeDuplicateChar3(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. You are given a list. Return the sum of odd elements from the given list | |
// Sample Input : [3,2,4,6,5,7,8,0,1] | |
// Output : 16 | |
void main() { | |
sumOdd(); | |
sumOdd2(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Definition : PFA Array Of Student name, by using dart pad divide all students into groupof 4. | |
// final List<String> studentArr = <String>[ | |
// 'Kalpit Seksariya', | |
// 'Gaurang Gajera', | |
// 'Bollam saiprakash', | |
// 'Dhruv Vaghela', | |
// 'Jaydeep Dhamecha', | |
// 'Jigar Pandya', | |
// 'Riddhi Bhavsar', | |
// 'Ankit Jadav', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Definition : PFA Array Of Student name, by using dart pad divide all students into group of 4. | |
// final List<String> studentArr = <String>[ | |
// 'Kalpit Seksariya', | |
// 'Gaurang Gajera', | |
// 'Bollam saiprakash', | |
// 'Dhruv Vaghela', | |
// 'Jaydeep Dhamecha', | |
// 'Jigar Pandya', | |
// 'Riddhi Bhavsar', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use of Ansynchronous Function adn Opration in Dart | |
// A future represents the result of an asynchronous operation | |
// it's have two states: uncompleted or completed. | |
// To define an async function, add async before the function body | |
// The await keyword works only in async functions | |
Future<String> createOrderMessage() async { | |
var order = await fetchUserOrder(); | |
return 'Your order is: $order'; // pizza |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
fullName("Harsh", "Shah"); // first Name , Last Name will Print | |
fullName("Harsh", "Shah", | |
"Software Developer"); //Titel, first,last name will prints | |
List vehical = ['Car', 'Bike', 'Cycle', 'Truck']; //list of strings | |
List vehical1 = ['Ship', 'Aeroplane', 'Rocket', 'Helicopter']; | |
final numbers = [42, -1, 299792458, 100]; // list of integers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Different types of loops in Dart | |
// while Loop | |
// Do While Loop | |
// For loop | |
// For In or For Each Loop | |
void main() { | |
//Function Calling | |
whileLoop(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Types of Increment & Decrement Oprators | |
// += | |
// -= | |
// *= | |
// /= | |
// (operand++) | |
// (operand--) | |
// (++operand) | |
// (--operand) |