Work related, C/C++ Programming

Make the following 3 functions work by filling in appropriate C code. This file

// Write a function to count the number of particular characters in a string.
// Do not use any standard library calls.
int CountCharacters(char* String, char Character)
//insert your code here

// 2.
// Write a function that reverses a string without allocating any extra storage.
void ReverseString(char* String)
//insert your code here

// 3.
// Write a function that returns the nth prime number corresponding to the number n passed.
// • Do not worry about overflow. Assume that a long will hold all required values.
// • Optimize for readability and compactness, not speed.
// • Do not use any complex math formulas to calculate it.
// • Do not use any math operators beyond addition, subtraction, multiplication, division.
// • I''m looking at your coding ability, not your math ability or your ability to go look up an algorithm on Google.
// Examples:
// GetPrime(1) == 2 // the first prime number is 2
// GetPrime(2) == 3 // the second prime number is 3
// GetPrime(3) == 5 // the third prime number is 5
// GetPrime(4) == 7 // the fourth prime number is 7
// GetPrime(5) == 11 // the fifth prime number is 11
// GetPrime(1000) == 7909 // the thousandth prime number is 7909
long GetPrime(long n)
//insert your code here
Posted Date: 3/26/2013 8:48:53 PM | Location : United States

Related Discussions:- Work related, Assignment Help, Ask Question on Work related, Get Answer, Expert's Help, Work related Discussions

Write discussion on Work related
Your posts are moderated
Related Questions
Program is to read the contents of a file: void main()    {   ifstream fin("ascii.txt");   char ch;   while(! fin.eof())     {   fin>>ch;   cout     }

6#666#665533999 where # is used as space.output is monkey

Inheritance is the process of forming new classes, called derived classes, from existing classes or base classes. The derived class inherits all the capabilities of the base class,

It''s that spooky time of year when the dead walk the Earth, things go bump in the night, and the Centers for Disease Control (CDC) recognizes the need for zombie preparedness (

Can you think of a condition where your program would crash without attaining the breakball, which you set at the straining of main()? A: C++ let for dynamic initialization of g

Derived Data Type: Array is derived data type to store large collection of data of only one data type. int mark[100]; char names[25]; Function: will be discussed early

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Project Description: I want someone to create and install a keylogger on a chrome browser. This could be a relatively simple job, please have experience with this type of work.

Explain the Command Line Parameters? The Command line arguments are parameters supplied to a program from the operating system. These arguments are parameters accepted to main