Write Client and server program in C language using UDP?
Write and run a client and a server program in C-language using UDP
In Java
// the string we want to process
final String str = "Mumbai";
// convenience conversion to characters
final char[] str_chars = str.toCharArray();
// letters used to keep track of which characters we've counted
final Set
// iterate through each character in str
for (int i = 0; i < str_chars.length; ++i) {
// store lower case version of ch so we only need to convert once
final char ch_l = Character.toLowerCase(str_chars[i]);
// only process this letter if we haven't done so yet
if (!letters.contains(ch_l)) {
// store letter
letters.add(ch_l);
// count number of times this letter is in str
int count = 1;
for (int j = i + 1; j < str_chars.length; ++j) {
if (ch_l == Character.toLowerCase(str_chars[j])) {
++count;
}
}
// output
System.out.format("%c%d", str_chars[i], count);
}
}
How do you draw a stock chart?
To view a stock's price chart, you need to use a service that offers them, like stockcharts.com. However, what you do with that information is entirely up to you, and takes experience and knowledge to make any use of it. This is a site that can help you learn how to use stock charts, spot chart patterns, formulate trading plans, etc.
http://onlycharts.com/
What does it mean for a city's function to be integrated?
To achieve a satisfactory level of co-ordination. City functions can be considered as nodes in a directed graph, or as inter-dependent variables of a system (the city that is). It follows that co-ordination is a must, for the system (city) to function as a whole.
Examples of hterogeneous and homogeneous data structure?
1:
struct data {
char *name;
int age;
} d;
2.
int x [300];
How do you write the sum of a number and 100?
The algebraic expression is n + 100, where n is the unknown number.
Write a c program to accept a numbers and generate square root cube and exponential values?
write a c program to accept a number and generate a square root cube and exponential values
Are instence variable are global or local variable?
Instance variables are not global nor local variables.
Variables in OOP are different from the counter parts in COBOL, FORTRAN, or C.
To define any variable in OOP, it must be defined within a class/struct, at instance or class level (static in C# or shared in VB.NET).
local variables usually referred to those defined within a method (of a class, instance-level or class-level) in OOP (object oriented programming).
global variables, to define one in OOP is difficult and violate the object oriented design principle. However, the singleton design pattern does address this issue.
Singleton pattern guarantees that the same instance (of that class) being the only one lives within your application (and globally accessible to that same instance), and hence the variables defined within this singleton may be treated as "global" variables
How do you display the square root symbol on output screen using C Plus Plus?
The the square root symbol can be displayed by using ASCII code
cout<<"press alt251"; pressing alt251 "��"
What is the C program for DFS and BFS?
Breadth First Search is the technique to find the shortest distance between some starting node and the remaining nodes of the graph. This shortest distance is the minimum number of edges traversed in order to travel from the start node to the specific node being examined. It is called BFS because the distances are given breadth wise. It is the faster search technique as the representation of the nodes and the edges are in the form of adjacency list representation. We can also use this technique for searching.
Depth-first search (DFS) is an algorithm for traversing or searching a tree, tree structure, or graph. One starts at the root (selecting some node as the root in the graph case) and explores as far as possible along each branch before backtracking.
/******************************************************************
-> This Program is to implement Depth First search.
-> Data Structers:
Graph:Adjacency List
Stack:Array
-> This program works in Microsoft vc++ 6.0 environment.
*******************************************************************/
#include
int visit[100];
class graph
{
private:
int n;
graph*next;
public:
graph* read_graph(graph*);
void dfs(int); //dfs for a single node
void dfs(); //dfs of the entire graph
void ftraverse(graph*);
}*g[100];
int dfs_span_tree[100][100];
graph* graph::read_graph(graph*head)
{
int x;
graph*last;
head=last=NULL;
cout<<"Enter adjecent node ,-1 to stop:\n";
cin>>x;
while(x!=-1)
{
graph*NEW;
NEW=new graph;
NEW->n=x;
NEW->next=NULL;
if(head==NULL)
head=NEW;
else
last->next=NEW;
last=NEW;
cout<<"Enter adjecent node ,-1 to stop:\n";
cin>>x;
}
return head;
}
void graph::ftraverse(graph*h)
{
while(h!=NULL)
{
cout<
h=h->next;
}
cout<<"NULL"< } void graph::dfs(int x) { cout<<"node "< visit[x]=1; graph *p; p=g[x]; while(p!=NULL) { int x1=p->n; if(visit[x1]==0) { cout<<"from node "< //Add the edge to the dfs spanning tree dfs_span_tree[x][x1]=1; dfs(x1); } p=p->next; } } void graph::dfs() { int i; cout<<"**********************************************************\n"; cout<<"This program is to implement dfs for an unweighted graph \n"; cout<<"**********************************************************\n"; cout<<"Enter the no of nodes ::"; cin>>n; for(i=1;i<=n;i++) g[i]=NULL; for(i=1;i<=n;i++) { cout<<"Enter the adjacent nodes to node no. "< cout<<"***************************************\n"; g[i]=read_graph(g[i]); } //display the graph cout<<"\n\nThe entered graph is ::\n"; for(i=1;i<=n;i++) { cout<<" < "< ::"; ftraverse(g[i]); } for(i=1;i<=n;i++) visit[i]=0; //mark all nodes as unvisited cout<<"\nEnter the start vertex ::"; int start; cin>>start; for(i=1;i<=n;i++) for(int j=1;j<=n;j++) dfs_span_tree[i][j]=0; cout<<"\nThe dfs for the above graph is ::\n"; dfs(start); cout<<"\n\nThe required dfs spanning tree is ::\n"; for(i=1;i<=n;i++) { for(int j=1;j<=n;j++) cout< cout< } } int main() { graph obj; obj.dfs(); return 0; }
How do you remove blarul c if nothing works and if you cannot open the file where avg found it?
You can try a program called The Cleaner Professional 4.1 found here: http://www.moosoft.com/products/cleaner/download/
Run the "evaluation" of it and it should sniff out all trojans/viruses and quarantine them. After that you need to go into the quarantine and delete them.
What is the coding to find the rightmost digit?
#include
void main()
{
long int n;
clrscr();
printf("Enter a number:");
scanf("%ld",&n);
printf("%d",n%10);
getch();
}
What is the value of separating interface from implementation in object oriented programming?
Say for example you had the following files:
What do preoperative instructions include?
information about reserving blood products for surgery.taking or discontinuing medications before the surgery.eating and drinking before surgery.limiting activities before surgery.preparing items to bring to the hospital the day of surgery.
How do you store integer value in address 0x1234 using pointers?
int *ptr = (int *)0x1234;
*ptr = value;
Note: NEVER do this.
How can you display a circle on computer screen with the help of c plus plus programming language?
You cannot. At least not with generic C++. Graphics are platform-dependent and therefore requires a suitable API and library for your specific platform and its hardware.
How many while statements are possible in do..while loop?
If you are asking how many statements can be a in while loop, there is no maximum. However, from a practical perspective you need to limit the number of statements to a small number to keep the logic understandable.
How do you get original cursor in turbo c?
In turbo c command prompt select "options" in that click on "environment" and next click on "editor" next select " Insertmode" and press"ok" .After that u will get a original cursor
hi this is padma priya if you get any doubts related to c language you can send mail to padma6959@gmail.com