Tampilkan postingan dengan label value. Tampilkan semua postingan
Tampilkan postingan dengan label value. Tampilkan semua postingan

Jumat, 13 Mei 2016

C Program to check entered value is character integer or special symbol

C# Program to check entered value is character, integer or special symbol

Program Statement:
Write a program which takes one value from user and check whether the entered value is character, integer or special symbol.

Solution:
 static void Main(string[] args)
{
char value;
int a;
Console.WriteLine("Enter value to check Character, integer or special symbols ");
value = Convert.ToChar(Console.ReadLine());
a=(int)value;
if (a >= 65 && a <= 90 || a >= 97 && a <= 122)
Console.WriteLine("Entered Value is Character");
else if(a>=48 && a<=57)
Console.WriteLine("Entered Value is Integer");
else if(a>=0 && a<=47 || a>=58&&a<=64 || a>=91&&a<=96 || a>=123&&a<=127)
Console.WriteLine("Entered Value is Special Symbols");
else
Console.WriteLine("Invlaid input :(");
Console.ReadLine();
}


Minggu, 24 April 2016

C Program should be able to search a value in the array using binary search algorithm

C# Program which takes n values in an array and then program should be able to search a value in the array using binary search algorithm

Program Statement:
Write a program which takes n values in an array and then program should be able to search a value in the array using binary search algorithm. Hint: You have to sort that array first because binary search can be applied only on sorted array

Solution:
 public class search
{
int n, num, s = 1, e, mid;
public void show()
{
Console.Write(" Enter length of array : ");
n = Convert.ToInt32(Console.ReadLine());
int[] array = new int[n];
Console.WriteLine(" Enter {0} numbers : ", n);
for (int i = 0; i < n; i++)
{
array[i] = Convert.ToInt32(Console.ReadLine());
}
for (int x = 0; x < n; x++)
{
for (int y = x + 1; y < n; y++)
{
if (array[x] > array[y])
{
int temp;
temp = array[y];
array[y] = array[x];
array[x] = temp;
}
}
}
Console.Write(" Enter number to search : ");
num = Convert.ToInt32(Console.ReadLine());
e = n;
mid = (s + e) / 2;
if (num == array[mid])
{ Console.Write(" Element {0} found! ", array[mid]); }
else if (num < array[mid])
{
for (int x = 0; x < mid; x++)
{
if (num == array[x])
{ Console.Write(" Element {0} found! ", array[x]); }
}
}
else if (num < array[mid])
{
for (int y = mid; y < n; y++)
{
if (num == array[y])
{ Console.Write(" Element {0} found! ", array[y]); }
}
}
else
Console.WriteLine(" Element not found! ");
}
}


Jumat, 18 Maret 2016

How To Get The Best Value From Your TCredits On Pricebender Penny Auctions

Pricebenders penny auctions are a very popular part of SFIs Tripleclicks ecommerce website. Auctions start at just one cent and Ive seen some early-bird bidders pick up fantastic bargains for just a few cents. (The trick is to bid on auctions at off-peak times of day...)

If you are not familiar with how penny auctions work, and would like to know how to get the best value out of bidding on the Tripleclicks Pricebenders penny auctions, I have just written an article on my main website titled:

Pricebenders Penny Auctions: How To Get The Best Value Per Bid!

In the article, I explain how Pricebenders penny auctions work, and offer 7 key tips to help you bid wisely and pick up some great bargains...

1. SAVE YOUR TCredits

TCredits cost money, so dont waste them! For example...

2. HOLD FIRE!

Wait until the last 5 seconds...

3. WORK OUT YOUR ENTRY AND EXIT PRICE

Dont spend too much too early....

4. HAVE AN EXIT STRATEGY

You cant win every time, so...

5. HANDLE "WBF" AUCTIONS WITH CARE!

WBF = Winner Bids Free! If you win, you get all your TCredits back. But...

6. AUTO BIDDING

Once an auction has begun you can...

7. USE YOUR MEMBER REWARD POINTS

If you become an active Tripleclicks Pricebenders bidder you will quickly accumulate Member Reward Points (MRP)....

See my original Pricebender auctions article for the full low down on how to TCredits wisely when bidding on Pricebender penny auctions.

Cheers for now,
David Hurley
SFI Executive Affiliate
P.S. I give away over 100 TCredits in prizes every month to active members of my SFI team. If youre looking for a free-to-join home-based Internet business opportunity with excellent products and services, and an active and supportive sponsor, Join SFI As Part Of My Team Today! :)
 

Tips And Trick Computer Copyright © 2016 -- Powered by Blogger