answersLogoWhite

0

📱

C Programming

Questions related to the C Computer Programming Language. This ranges all the way from K&R to the most recent ANSI incarnations. C has become one of the most popular languages today, and has been used to write all sorts of things for nearly all of the modern operating systems and applications. It it a good compromise between speed, power, and complexity.

9,649 Questions

What is the factorial of 120?

The answer is too long to type on here

but you can get a solution on your TI-89

go to Math

7:Probability

1:!

then type in 120!

120!=66895029134491270575881180540903725867527463331380298102956713523016335..

=(roughly) 6.6895x10198

Who is author Henri J M Nouwen?

Henri was a Roman Catholic priest. He taught at Notre Dame, Yale, and Harvard. He wrote a great many books, probably the best known is "The Wounded Healer". He died about ten years ago of a heart attack in his native Holland.

What has the author Edwin N C Barnes written?

Edwin N. C. Barnes has written:

'Who's who in music education' -- subject(s): Instruction and study, Music

'The bard of Pittsburgh'

'Music as an educational and social asset (the instrumental contribution)' -- subject(s): Instruction and study, Music

Which accepts an integer array of size n and prints every third value of the array?

You can loop through the array, and print out every third element. If the index used for looping is called "i", you can test whether "i" is a multiple of three (i % 3 == 0).

Or, and perhaps more efficiently, you can increase the index 3 at a time, for example:

for (i = 0; i <= theArray.length, i+=3)

{

...

}

Which important property do stack algorithm have?

They will scratch and mess up. They will scratch and mess up. They will scratch and mess up. They will scratch and mess up. They will scratch and mess up. They will scratch and mess up.

What is a programming in c?

C language is developed by Dennis Ritchie at Bell Laboratories in 1972. To know more about C Programming and learn C Programming from basics to advance visit codeforhunger. com

Give one reason you shouhld make the paging file maximum size the same as the paging file initial size?

From TechNet: Set the Same Initial and Maximum Size

Setting the paging file's initial size and maximum size to the same value increases efficiency because the operating system does not need to expand the file during processing. Setting different values for initial and maximum size can contribute to disk fragmentation.

Why is the hard drive labeled C?

C:/ c is the hard drive a brilliant question, as a computer tech, i always just accepted it as fact upon contemplation i would answer that it is a randomly chosen identifer for the local drive you would probably have had to be there when the engineer was configuring, for all intents and purposes, one of the first artificial intelligence prototypes and, well, "i'll name it C" you could probably get the correct answer from a archived computer book, documentary, etc you will never see "his" notes c (lower case) is the constant for the speed of light Note: This is a correct answer but somebody changed the question on you...It has been reverted back to the original. Answer 2: The earliest computers operating under the various DOS versions were not equipped with a hard drive. They operated, in some cases by running the operating system out of one floppy drive and using the second floppy for applications. The floppies were addressed as A and B. After hard drives began to be installed, it was still common for computers to have two floppies. After the old 5-1/4 floppy format gave way to the new 3-1/2, it was common to find both drives on computers because the user was assumed to have all their important stuff still on the old 5-1/4's. That created a bit of a problem because the A and B were so firmly entrenched in their use for addressing the floppy drives that it was impractical to use A or B for anything else. Also, software was written to default to the C-drive when programs were installed. C:\ does not always refer to a hard drive, it is used to address the first un-hidden DOS sector on an IDE or SATA device. As such, a hard drive may be partitioned to have many partitions and those partitions can be assigned letters of your choosing by using drive management programs. Networked computers can also map different letters to various network locations. Optical drives are generally going to take a higher letter if the system has a hard drive. The C-drive does not always have to refer to a hard drive. When a virtual drive is created in memory, as when you use Windows' recovery, it can be addressed as C. Linux, Unix and MacOS do not use any drive letters.

How do you write a C program to insert a sub-string into given main string from a given position?

#include

#include

void main( )

{

char st[20],sub[10],temp[10];

int pos, i, j;

clrscr( );

printf("Enter the main string:");

gets(st);

printf("\nEnter the substring to insert:");

gets(sub);

printf("Enter the index position:");

scanf("%d",&pos);

if(pos<=strlen(st)) {

for(i=0;i<=strlen(st);i++) {

if(i==pos)

{

for(j=0;st[i]!='\0';j++) // to store the 'st' to 'temp' from given position.

{

temp[j]=st[i];

i++;

}

temp[j]='\0';

i=pos;

for(j=0;sub[j]!='\0';j++) // to insert a sub-str to main string.

{

st[i]=sub[j];

i++;

}

for(j=0;temp[j]!='\0';j++) // Lastly to insert the 'temp' to 'st' after sub-str.

{

st[i]=temp[j];

i++;

}

st[i]='\0';

}}

printf("\nAfter adding the sub-string: %s",st);

}

else

printf("\nSorry, it is not possible to insert a substring in that position.");

getch();

}

How can you tell if a 1973 trans am is a SD 455 or just a 455?

Typically, if it is a super duty, you'll find "455SD" decals on the shaker scoop. If yours is a high output or standard engine, it will be badged as simply 4 5 5. If you're still unsure, the super duty utilised round port cylinder heads and an LS2 intake. It also included cast iron exhaust header-manifolds.

Write a program to check whether the number is divisible by 3 or not by using the?

I assume you mean is an if the number is an integer multiple of 3
i am unfamiliar with C but the theory would be,
find if a is integer multiple of 3
b=a/3
b==round(b).
if 1 "yes"
else "no"
this is an inefficiency way but will get the job done

What is the program that prints all prime numbers from 0 to 300 in C plus plus?

#include

bool is_prime(unsigned num)

{

// 2 is the first prime and the only even prime.

if (num < 2) return false;

if (num == 2) return true;

if (num % 2 == 0) return false;

// Divide num by every odd number from 3 up

// to and including the square root of num.

// If any division results in no remainder

// then num is not prime.

unsigned max = sqrt ((double) num) + 1;

unsigned div = 3;

do {

if (num % div == 0)

return false;

} while ((div += 2) < max);

// If we get this far, num is prime.

return true;

}

int main()

{

std::cout << "Prime numbers in the range 0 to 300:\n" << std::endl;

unsigned num = 0;

do {

if (is_prime (num))

std::cout << '\t' << num << std::endl;

} while( num++ < 300);

std::cout << std::endl;

}

Example Output

Prime numbers in the range 0 to 300:

2

5

7

11

13

17

19

23

29

31

37

41

43

47

53

59

61

67

71

73

79

83

89

97

101

103

107

109

113

127

131

137

139

149

151

157

163

167

173

179

181

191

193

197

199

211

223

227

229

233

239

241

251

257

263

269

271

277

281

283

293

What is array What is difference between array and simple variable?

An array stores several values - for example, several numbers - using a single variable name. The programmer can access the individual values with a subscript, for example, myArray[0], myArray[5]. The subscript can also be a variable, for example, myArray[i], making it easy to write a loop that processes all the elements of an array, or some of them, one after another.

What is stdin stdout and stderr in c?

stdin is short for "standard input." When you input data into the terminal while the program is running, this is where it goes.stdout is short for "standard output." This is where all of the data that you print out of your program (via printf(), puts(), etc.) goes.

stderr is short for "standard error." This is where you should print your error messages to (via fprintf(), fputs(), etc.).

C prigram to create sales report using arrays?

#include<stdio.h>

#include<conio.h>

#include<stdlib.h>

#include<math.h>

void main()

{

float amt,bal=0,min=500,cor;

char name[50];

int ch,ano;

clrscr();

printf("\nDetails of new account holder");

printf("\nEnter the Name:");

scanf("%s",name);

printf("\nEnter your account number maximum 4digit:");

scanf("%d",&ano);

printf("\n\tThank you %s.\n\tYour account is created t oour bank.",name);

printf("\nMinimun account balance Rs.500");

do

{

printf("\n\t1.Deposite\n\t2.Withdrawal\n\t3.Balance enqiury\n\t4.Exit" );

printf("\nEnter your chioce:");

scanf("%d",&ch);

switch(ch)

{

case 1:

printf("\nEnter the amount to deposite:");

scanf("%f",&amt);

bal=bal+amt;

printf("\nYour transaction is successful.amount debited your acount");

break;

case 2:

printf("\nEnter the amount to withdrawal:");

scanf("%f",&amt);

cor=bal-amt;

if(cor>=min)

{

printf("\nThe amount credited your account");

bal=bal-amt;

}

else

{

printf("\nThe Minimun balance is to low");

}

break;

case 3:

printf("\nYour Account balance is:%.2f",bal);

break;

case 4:

printf("\nThe transaction is close");

exit(0);

}

}while(ch<=4);

getch();

}

How would you program a C application to run in windows mode?

u must use textmode(ch80); works on 80 by 25 dimension.

or texmode(c40); works on 40 by 25 dimensions........ further info: bhopalcoolboy@gmail.com

Write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student?

write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student.

How can I improve my skills at the piano?

Not knowing what skill level you are, it is difficult to suggest any particular books, etc. BUT technical ability is what everyone needs to work on, so as painful as it may seem, you need to work scales (not necessarily from memory), arpeggios chords; so if you don't own a good scale book, go to a music store and you'll find one on your level. AND you should add to that some etude books; there again look and see what you can handle AND if you don't own a book of song material that you like, try Broadway of sacred, anything will do for that area.

AnswerThere is another school of thought on this question, and it is not just my passing thought. It is held by many piano educators. They hold that the best way to improve skills is within the context of the music you actually want to play. In other words, concentrate on making music, and do that by playing and practicing the music you want to play. Choose the music well, and practice technical difficulties as they present themselves in that music.

I'm not sure which approach I favor. I studied classical piano as a kid, and definitely the first answer was more like the approach I took. But, especially if you are not heading for a concert or recording career, I think I'd suggest that this music-based approach is better. Just play and practice the music you like.

As a follow-up, and regardless of the kind of music you play, You can improve almost anything you play by doing the following. Make the music 'more difficult to play' during your practice than it actually is. This is what I mean. Isolate a part of the music you want to improve. Say that it is a passage written all or mostly in eighth notes. Change the rhythmic pattern so that it is like dotted eighths/sixteenths. Practice it this way. Then change, if you can, so that the passage is played as sixteenths/eighths. This may be very tricky. Play it as slow as you have to in order to master it like this. Find other ways to change the passage. If your volume over a given line is uneven, then practice it unevenly. Yes, that is what I said. Practice it, for example, with the stresses in a given pattern: loud-soft-loud-soft-loud-soft. Then practice the same passage with the stresses switched: soft-loud-soft-loud. For a real challenge, mix the rhythm patterns and the volume patterns. Master it every way that you can dream up to change it. When you go back to playing it as written, not only will the passage be smoother, but it will feel, and it will be, easier. There are several other practice 'tricks' that you can use; good teachers can share some of them with you.

One important thing is that for every change you make to the music during practice, mix it up so that you are spreading the affect of the change over all the fingers as much as possible. This way you are spreading the work out to all the fingers, and this is how you repair habitual errors.

Even more important than that is to play music that you like, and to have a great time playing. I know how much pleasure piano playing can give over the course of a lifetime. Stay with it.

Write a program in java to enter a String and convert all cat to dog?

import java.io.*;

class CatToDog

{

protected byte words(String xs)

{

byte a=0;

for(byte i=0;i<xs.length();i++)

{

if(xs.charAt(i)==' ')

a++;

}

return (byte)(a+1);

}

protected static void main()throws IOException

{

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));

CatToDog o=new CatToDog();

System.out.print("Enter the String: ");

String s=in.readLine();

byte a=o.words(s),b=0,c=0;

String w[]=new String[a];

for(;b<a;b++)

w[b]="";

for(b=0;b<s.length();b++)

{

if(s.charAt(b)==' ')

c++;

else

w[c]+=s.charAt(b);

}

for(b=0;b<a;b++)

{

if(w[b].equalsIgnoreCase("Cat"))

System.out.print("Dog ");

else

System.out.print(w[b]+" ");

}

}}

Assembly language pgm to find sum of n numbers?

C100 LXI H C200 21 ;

Load the HL register pair immediately

C101 00 ;

C102 C2 ;

C103 MOV B M 46 ;

Move the memory content

(Total number of

data)

in to B register

C104 MVI C 00 0E ;

Initialize

the

C register with 00

H

C

105 00 ;

C106 SUB A 97 ;

Clear the ac

cumulator

C107 INX H 23 ;

Increment the HL register pair (to get the

next

input data)

C108 MOV A M 7E ;

Move the memory content

in to

accumulator

C109 DCR B 05 ;

Decrement the B register

c

o

n

tent

C10A INX H 23 ;

Increment the HL register pair

C10B ADD M 86 ;

Add the memory content to

accumulator

C10C JNC C110 D2 ;

Jump if carry = 0, to C110

H

C10D 10 ;

C10E C1 ;

C10F INR C 0C ;

Increment the C register content

C110

DCR B 05 ;

Decrement the B register content

C111 JNZ C10A C2 ;

Jump if no zero to C10A

H

C112 0A ;

C113 C1 ;

C114 STA C300 32 ;

Store

the

accumulator content

(sum) at C300

H

C115 00 ;

C116 C3 ;

C117 MOV A C 79 ;

Move the C register content to accumulator

C118 STA C301 32 ;

Store

the

accumulator content

(

carry

) at C300

H

C119 01 ;

C11A C3 ;

C11B HL

T 76 ;

Halt the exection

Who is the inverter of c-language?

I think you mean "inventor". There were two: Dennis Ritchie and Ken Thompson.