Netbeans Tutorial – Cookies
The following video demonstrates on using Cookies in Java Servlets using Netbeans IDE
The following video demonstrates on using Cookies in Java Servlets using Netbeans IDE
This is the solution to “Tic-Tac-Toe-Tomek” problem of the Code Jam 2013 competition. Problem details: Tic-Tac-Toe-Tomek is a game played on a 4 x 4 square board. The board starts empty, except that a single ‘T’ symbol may appear in …
This question was asked in Round 1 of Code Jam 2008 contest. The problem You are given two vectors v1=(x1,x2,…,xn) and v2=(y1,y2,…,yn). The scalar product of these vectors is a single number, calculated as x1y1+x2y2+…+xnyn. Suppose you are allowed to …
I found this question at codejam. You can find the problem here. So lets get onto the problem. Problem You receive a credit C at a local store and would like to buy two items. You first walk through the …
I found this question while surfing through the internet. The task is to write a function that accepts a number n and returns the square of n. However, we are not allowed to use the multiplication or exponential operators in …
This program is a solution to Studious Student problem from Facebook Hacker Cup. The problem can be found here: link. The problem: A double-square number is an integer X which can be expressed as the sum of two perfect squares. …
This program is a solution to Studious Student problem from Facebook Hacker Cup. The problem can be found here: link. The problem: Studious Student You’ve been given a list of words to study and memorize. Being a diligent student of …
To start off, here is a little information about the Hangman game. From Wikipedia: The word to guess is represented by a row of dashes, giving the number of letters and category of the word. If the guessing player suggests …
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
using System; class Program { static void Main(string[] args) { int i,tot=0; for (i = 0; i <= 20; i++) { if (i % 2 == 0) {} else { goto cal; } cal: tot = tot + i; } Console.WriteLine("Sum of odd numbers from 0 to 20: "+tot); Console.ReadKey(); } } |
Output:- Sum of odd numbers from 0 to 20: 100 The goto statement is used as a jump statement that skips some of the some that we don’t want to execute on some condition….
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
using System; class Program { static void Main(string[] args) { int s=0; for (int i = 1; i<= 10; i++) { if (i % 2 == 0) s = s - i; else s = s + i; } Console.WriteLine("The value of s is:"+s); Console.ReadKey(); } } |
Output:- The value of s is: -5