#include<iostream>
#include<list>
struct item
{
item(const char ch):chr(ch), count(1){}
char chr;
size_t count;
};
int main()
{
const size_t size=50;
size_t idx;
std::list<item> freq;
std::list<item>::iterator iter;
std::string test;
for(idx=0; idx<size; ++idx)
test.push_back('a'+rand()%26);
for(idx=0; idx<size; ++idx)
{
for(iter=freq.begin(); iter!=freq.end() && (*iter).chr!=test[idx]; ++iter);
if( iter!=freq.end() )
++(*iter).count;
else
freq.push_back(item(test[idx]));
}
std::cout<<"Frequency table of the string:\n""<<test.c_str()<<""\n"<<std::endl;
for(iter=freq.begin(); iter!=freq.end(); ++iter)
{
item& itm=*iter;
std::cout<<itm.chr<<" = "<<itm.count<<std::endl;
}
std::cout<<std::endl;
}
There is no need to write a C program for circuit analysis; there are lots of packages out there that already do that (for example, Spice).
Writing a C program that uses dynamic memory allocation to sort names in ascending order is a typical computer science assignment. To write this program, you must be in UNIX.
To write a C program to determine if something is odd or even you need to be a programmer. To write a program in C is complicate and only done by programmers.
To write a C++ program to display the student details using class and array of object.
c#
int main (void) { puts ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); return 0; }
Every character in C++ is basically belongs to short. You can convert entered characters to short, compare their values and according to the values sort them in alphabetical order.
a c program for creat a virus
Into the source program.
Write a c program to compute the surface area and volume of a cube
There is no need to write a C program for circuit analysis; there are lots of packages out there that already do that (for example, Spice).
Writing a C program that uses dynamic memory allocation to sort names in ascending order is a typical computer science assignment. To write this program, you must be in UNIX.
To write a C program to determine if something is odd or even you need to be a programmer. To write a program in C is complicate and only done by programmers.
For first find an example program.
Use a text-editor program.
To write a C++ program to display the student details using class and array of object.
c#