All Answers Tagged With j
- 0for i = 1, 100 do -- The range includes both ends. karlSum = karlSum + iend-- Use "100, 1, -1" as the range to count down:fredSum = 0for j = 100, 1, -1 do fredSum = fredSum + j end-- In general, the range is begin, end[, step].-- Another loop construct:r
- import javax.swing.*;
class Registration extends JFrame{Registration() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JFrame f=new Jframe("Registration Form");
JLabel l1,l2,l3,l4;
JTextField t1,t2;
JPasswordField p1,p2;
l1=new J
- 0for i = 1, 100 do -- The range includes both ends. karlSum = karlSum + iend-- Use "100, 1, -1" as the range to count down:fredSum = 0for j = 100, 1, -1 do fredSum = fredSum + j end-- In general, the range is begin, end[, step].-- Another loop construct:r
- make this code simple and easily understandable for beginners:
# number of rows
rows = 5
k = 2 * rows - 2
for i in range(0, rows):
# process each column
for j in range(0, k):
# print space in pyramid
print(end=" ")
k = k - 2
- int ctr = 100; one: for (int i = 0; i < 10; i++) { two: for (int j = 0; j < 7; j++) { three: while (true) { ctr++; if (i > j) { break one; } else if (i == j) { break two; } else { break three; } } } } System.out.println(ctr);
- d = {'Mark': 100.0, 'Peter': 50.0, 'John': 25.0}for i, j in d.items(): print (i + ' pays ' + str(j))
- let b = "10000";
let a = "1";
let arr1 = a.split("");
let arr2 = b.split("");
console.log(arr1)
console.log(arr2);
let maxArr = arr1.length > arr2.length?arr1:arr2;
let k = maxArr.length-1;
let i = arr1.length-1;
let j = arr2.length-1;
let ans = [];
let
- j
- public class PascalTriangle {
public static void generate(int numRows) {
for (int i = 0; i < numRows; i++) {
for (int j = 0; j <= i; j++) {
System.out.print(binomialCoeff(i, j) + " ");
}
System.out.println();
}
}
}
public static int binomialCoeff(
- f and j keys
- for (i = 0; i < N; i++) for (j = 0; j < N; j++) { .... some O(1) code ... }
- find error #include <iostream>
using namespace std;
int main()
{
int arr[] = {5, 1, 4, 2, 3};
int n = sizeof(arr) / sizeof(arr[0]);
for (int i = 1; i <= n - 1; i++)
{
for (int j = 0; j < n - 1; i++)
{
if (arr[j
- void InsertionSort(int * a, int n) { int i, j, x; for (i = 1; i < n; i++) { x = a[i]; j = i - 1; while (j >= 0 && a[j] > x) { a[j + 1] = a[j]; j = j - 1; } a[j + 1] = x; } }
- what is the time complexity of fun()? int fun(int n) { int count = 0; for (int i = 0; i < n; i++) for (int j = i; j > 0; j--) count = count + 1; return count; }
- class Solution:
def reverseVowels(self, s: str) -> str:
res = ""
vowels = {"a","e","i","o","u","A","E","I","O","U"}
j = len(s)-1
for i in range(len(s)):
if i<j:
if((s[i] in vowels) and(s[j] i
- curly j
- Robinhood coding question 1, Given an array of integers a, the task was to count the no of pairs i, j , such that a[i] and a[j] are digit anagrams. In the given time frame, this is what i wrote. Kindly excuse me for the brute force technique. Thank you.
- private static void calcola(int i , function<integer , integer>fn){ int r = 0 ; for (int j = i ; j>0 ; j--) r = fn.apply(r); System.out.println(r); } calcola (9 , (p) -> { return p + 1;});
- j assiifg
- j hgkjghhuihh hjjkfvj hrthkgh kr thkltg]
- #include <iostream> using namespace std; struct link //one element of list { int data; //data item link* next; //pointer to next link }; class link list //a list of links { private:// w w w. j a v a2 s . co m link* next; //pointer to first link public: li
- django query to return User whose first name starts with j or last name starts with h
- <script> for (let i = 0 ; i = i + 5 < 0 ; i = i * 5) { for (let j = 0; j < i; j++) { document.write(' * ') } document.write('<br/>') i= (i*(-1/(5*i))) } </script>
- z/cxv.x.c,mm///.,mzmx,c////.,/,/.,mvc./zxhj jk aks d j kha;od
- A sphere is a perfectly round geometrical object that is three dimensional, with every point on its surface equidistant from its center. Many commonly-used objects such as balls or globes are spheres. If you want to calculate the volume of a sphere, you j
Browse Answers By Code Lanaguage
Select a Programming Language