C++ is general-purpose and portable, which is common to many high-level languages, but it excels in terms of performance, comparable to that of assembly language. This is not surprising given the amount of work that goes into optimising the native machine code that the C++ compiler produces.
Java is arguably more popular today (especially with amateur programmers), but it doesn't perform well when compared to C++. This is largely due to the much higher level of abstraction which requires compiled programs to be executed and interpreted by the Java virtual machine. The main advantage of Java is that the abstraction allows Java programs to be run on any platform that supports the JVM without the need to modify the source code and recompile, which is the main disadvantage of C++. However, in terms of performance alone, few languages can compete with C++, hence its huge popularity in the community.
Why should use extreme programming methodology?
The purpose of extreme programming methodology is to improve software quality and responsiveness to meet the customer's requirements. As frequent changes require updated programming to make things run smoothly.
What type of a program is used in order to enter c source code?
What type of a program is used in order to enter C source code
Delphi was the Oracle of Apollo. It was there that mortals went to seek answers to their future. A young priestess sat on a tripod, inhaling fumes from the crevice that she sat by, and priests told the seeker what she had said. It was usually ambiguous, and the seeker had to figure out the meaning of it.
Besides the second letter of the alphabet it can also mean bytes.
C program for knapsack algorithm?
#include<stdio.h>
#include<conio.h>
int w[10],p[10],v[10][10],n,i,j,cap,x[10]={0};
int max(int i,int j)
{
return ((i>j)?i:j);
}
int knap(int i,int j)
{
int value;
if(v[i][j]<0)
{
if(j<w[i])
value=knap(i-1,j);
else
value=max(knap(i-1,j),p[i]+knap(i-1,j-w[i]));
v[i][j]=value;
}
return(v[i][j]);
}
void main()
{
int profit,count=0;
clrscr();
printf("\nEnter the number of elements\n");
scanf("%d",&n);
printf("Enter the profit and weights of the elements\n");
for(i=1;i<=n;i++)
{
printf("For item no %d\n",i);
scanf("%d%d",&p[i],&w[i]);
}
printf("\nEnter the capacity \n");
scanf("%d",&cap);
for(i=0;i<=n;i++)
for(j=0;j<=cap;j++)
if((i==0)(j==0))
v[i][j]=0;
else
v[i][j]=-1;
profit=knap(n,cap);
i=n;
j=cap;
while(j!=0&&i!=0)
{
if(v[i][j]!=v[i-1][j])
{
x[i]=1;
j=j-w[i];
i--;
}
else
i--;
}
printf("Items included are\n");
printf("Sl.no\tweight\tprofit\n");
for(i=1;i<=n;i++)
if(x[i])
printf("%d\t%d\t%d\n",++count,w[i],p[i]);
printf("Total profit = %d\n",profit);
getch();
}
What is the C program for byte stuffing with the output?
//Sender
#include<string.h>
#include<stdio.h>
#include<unistd.h>
#include<fcntl.h>
#define SIZE 40
struct frame
{
char str[SIZE+1];
char tmp[2*SIZE];
char flag;
char e;
char final[2*SIZE];
}s;
main()
{int fd,len1;
int i,j,len;
fd=open("b1",O_WRONLY);
printf("\nEnter flag character and escape character for byte-stuffing:");
scanf("%c %c",& s.flag,&s.e);
printf("\nEnter string:");
scanf("%s",s.str);
len=strlen(s.str);
for(i=0,j=0;i<len;i++,j++)
{
if(s.str[i]==s.flag)
{
s.tmp[j]=s.e;
s.tmp[j+1]=s.flag;
j++;
continue;
}
else if(s.str[i]==s.e)
{
s.tmp[j]=s.e;
s.tmp[j+1]=s.e;
j++;
continue;
}
else
{
s.tmp[j]=s.str[i];
}
}
printf("\nAppended string is==>%s \n",s.tmp);
len1=strlen(s.tmp);
for(i=0,j=0;i<=len1;i++,j++)
{
if((i==0)(i==len1))
{
s.final[j]=s.flag;
s.final[j+1]=s.tmp[i];
j++;
continue;
}
else
{
s.final[j]=s.tmp[i];
}
}
printf("\nFianal string is==>%s\n",s.final);
write(fd,&s,sizeof(s));
}
//Reciver
#include<string.h>
#include<stdio.h>
#include<unistd.h>
#include<fcntl.h>
#define SIZE 40
struct frame
{
char str[SIZE+1];
char tmp[2*SIZE];
char flag;
char e;
char final[2*SIZE];
}r;
main()
{
int fd,len1;
int i,j,len;
mknod("b1",010666,0);
fd=open("b1",O_RDONLY);
read(fd,&r,sizeof(r));
printf("\nFlag character is==>%c\n",r.flag);
printf("\nEscape character is ==>%c\n",r.e);
printf("\nAnd actual message was ==>%s\n",r.str);
printf("\nReceived message is %s\n\n",r.final);
}
/*****************
[mca222@rcclinux mca222]$ cc -os byte_s.c
[mca222@rcclinux mca222]$ cc -or byte_r.c
[mca222@rcclinux mca222]$ ./r&
[1] 1570
[mca222@rcclinux mca222]$ ./s
Enter flag character and escape character for byte-stuffing:#
@
Enter string:sim#andh@ar
Sending message is==>#sim@#andh@@ar#
Flag character is==>#
Escape character is ==>@
And actual message was ==>sim#andh@ar
Received message is #sim@#andh@@ar#
What is basic computer programming?
It could be one of two things:
What is a complier in computer language?
A compiler is a program that translates a programming language (like c++, java, pascal, php etc...) to a language that computers can "understand" (i.e. "1001010110101010...")
How do you generate binary sequence for a decimal sequence?
No one on this site will know how do this. It's far too complicated, as for me I think you need to figure out how to do this yourself.
How do you shutdown a computer using command prompt?
Before shutting down your system Close all open file and folders. Follow these step:-
1. Click start Button or Windows Logo Left bottom corner
2. Click Shut Down.
Or you can use also shut down using CTRL ALT Delete button. or need any assistant call Techvedic expert.
What are computer spreadsheet programs?
There are several spreadsheet programs available. The most well known is probably Microsoft Office Excel. However, Open Office has a spreadsheet which has open source code and is available free under a GNU license from Sun Microsystems (see link below).
A spreadsheet is a program that allows the user to enter data in a tabular format (with columns and rows) and then perform various calculations and other manipulations on that data. For example, a user might enter a column of sales figures and instruct the software to total that column. Later, if the user wishes to change a value already entered, remove a value or add a new value, the spreadsheet will recalculate automatically without requiring the user to re-enter all of the values.
Spreadsheets can be used for anything from basic accounting to complex data analysis including graphs, statistics, and regressions. Spreadsheets can also sort data, for example alphabetizing a list of inventory.
Other contributors have said:What is the purpose of constructor in object oriented programming?
A constructor in a class is one of the first pieces of code to be executed when you instantiate a class. The purpose of constructors is to have code that initialize the class and prepare the variables that may be required by the class...
Write a program in C language to implement the apriori algorithm?
JavaScript is one program that has been written in C to implement the Apriori algorithm. There are also several other known programs available on the Internet that implement it as well.
How do you make a dedication in a case study?
I dedicate this research work to my subject teacher who never failed to teach and guide me, to my family who supports me in everything, to my friends who helped me finished this project, and most of all to the Almighty God who gives me strength and good health while doing this.
Explain the differences between C Language and C plus plus Language?
i want a c programme....if i have a collection of alphabhate appox 2000 or
more...alphabates r repeted...
i want to write a prograam such that first 7 terms r wrriten in first
line then next 7 alphabets r writen in next line..
not fully clear ??
i would give u an example: TTCATCATTCCTAATATTTTTCTTGTAGTTGTTTTAAAAAAGGAATTAAC
ATCCAATATTCTGTATTACATACTGTACACCAGATTTTGATTTCAGAAAA
CAATATTTGATGTATAACTTCCACTTAATTTAAATTTAATAAACTTTTAT
TTCAGAGATATTTGATTAGTTTACAATCTAAGAGTTATTCTTAAGAGTTT
CAGTGGAATTTTCTTAATTTTTCTAAAGATATTCCTACTCTCTTGATCAT
ATTCTAAGTACATATGAGTACATGTACATTCTTATACAATGTCTAAATGG
GTTAGAAAATTATTATACCTATAGAAGCGAAACTTGGAAATTAATAGAAT
CACTTAAACCAAAATCTTTATAAGACACAATTCTATTGATTTTAAAGCTT
CTGCTTTCCAGGCTCTGTTTTCCAGAGTTTATAATTACGTAGTTTTTAGT
AGATGAAAATAATGGATTCTTGTACCTAACATTTTATCCTCTTAGATCTA
AGAGCCGAAGCTATAGAACTTTGTTAGACTATTTGGCAAGCAAAATATAT
GACAGTAAATATCAGAATTTTATGGTTTGACCAGCGCTTATCACATTCCC
AATTCAGTGAGAAAAATTCATCTGGGACACAACAGGGTACTCTTCTCTGT
TTGCCCAGAATCAGCTCTGGATTTTAAGCCCAGACTTCAGTGGACCCAGA
TAGAAAATATAAAGTCTCTGATCTATAGGCCACATCAGGATGTTATTTTA
TGAAGAGTTCTAGAGCAAGGTTGCGGAAATCGGGGTGGAGATGGGGAGCA
GTGACTCCTCCAAATATTCATTGCTAACAGGCCATTCTATGCAGTTTGTT
TTAACAAATCCTGGGTTAAACTGAGGCCACAGGACATGATGGGCTGTTCT
ATAAAGCATTCTAAGTGGAGAGGAGACGATAGGGCATATGAAATTCACTA
AACTCTCTGGAAAAAAAATATGTATATATTAAAAACCAAGACTGGAATCA
GTGCAACAGTGGGAACTACCTTTTACAAGTATCCATTGCTTCATAAACTC
CATTTGTTTGGACCAATCCCTTAAACAAAAGCAAGGCAAATTTTACATGG
ATTTAGAGCCTAGGTCAGGTTATTAGGATTATAAATTTTCCACTGGTATG
TCATTGTGATTATCTTTGTTTTTGTCTTTCTGAAAGATTGGATTTTCTAT
AACACCTTGTGTAAGAAAATAAAAAACTTGATCTAACTGAA suppose this is a sequence...
i want to write first 7 alphabets in first line...(1st to seventh)
TTCATCA
next 7 in next line...(2nd to ...8th)
TCATCAT
next 7(3rd to 9th)....and so on.... can u help me to write this programm.... if u write this programm u get a treat from me....
How do you use a graphing calculator?
go to youtube.com and type same question in it's search box you will get your answer
Is computer Essentials the same as computer programming?
No. Computer essentials relate to the basic hardware knowledge (identifying input/output devices, the processor and storage devices), operations and general usage (executing and using programs such as a word processor and a spreadsheet) and file maintenance (organising, saving and deleting user documents). Computer programming requires skill and knowledge that exceeds the basic requirements of computer essentials.