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

How do you write a program in C to check whether a number is a palindrome or not?

The simplest method is to reverse the digits of the original number and check to see if the reversed number is equal to the original. This is not an efficient way of doing it but, for ints or long ints, it works well enough.

void main()

{

// get the number to check

long int n;

printf("ENTER A NUMBER: ");

scanf("%ld",&n);

long int n1,mod;

// make a copy of the original number in n1

n1=n;

// store the reversal in rev

long int rev=0;

while(n>0)

{

// grab the rightmost digit of n

mod = n%10;

// shift all digits of rev left, then add in the new digit

rev = rev * 10 + mod;

// shift all digits of n to the right (removing the rightmost one)

n = n / 10;

}

// after the loop, rev will have the opposite digit ordering of n1;

// if these two values are equal, then we have a palindrome

if (n1 == rev)

printf("%ld is a palindrome\n",n1);

else

printf("%ld is not a palindrome\n",n1);

}

Alternate method:

Split the number into its digits, as on the example below: Number: 3592 1st digit: 3592%10 = 2 3592/10=359. ... 2nd digit: 359%10 = 9 etc. Store these into an integer array, then check if all digits correspond to digits at the reflected position.

Is it any valid printable ascii character can be used inan identifier?

In programming languages, identifiers are used to name variables, functions, etc. In most languages, identifiers must start with a letter (uppercase or lowercase) or an underscore, followed by letters, digits, or underscores. Therefore, not all printable ASCII characters can be used in an identifier. Symbols such as @, #, $, and % are typically not allowed in identifiers.

Write a c program to find sum and average of array elements?

/*Program in c to to find the sum and average of 1D array*/

#include<stdio.h>

#include<conio.h>

void main()

{

int a[5],i,sum;

float avg=0.0;

printf("Enter the elements of array");

for(i=0;i<5;i++)

scanf("%d" ,&a[i]);

sum=a[0]+a[1]+a[2]+a[3]+a[4];

printf("\n The sum of array is %d " ,sum);

printf("\n The average of array entered is %f ", avg);

getch();

}

The minimum number of bits required to store the hexadecimal number FF is?

To store the hexadecimal number FF, we need to convert it to binary first. FF in hexadecimal is equivalent to 1111 1111 in binary, which requires 8 bits to represent. Each hexadecimal digit corresponds to 4 bits in binary, so two hexadecimal digits (FF) require 8 bits to store.

10011 is the binary number system way of writing?

The binary number 10011 is equivalent to the decimal number 19 in the base-10 number system. In binary, each digit represents a power of 2, starting from the right with 2^0, 2^1, 2^2, and so on. Therefore, 12^4 + 02^3 + 02^2 + 12^1 + 1*2^0 = 16 + 0 + 0 + 2 + 1 = 19.

What are all of the arrays of 18?

Jasmine puts 18 hats away she puts a eq number of hats on 3 shelves

How can I find the South Node in my birth chart?

To find the South Node in your birth chart, you can look for the symbol that resembles an upside-down horseshoe. It is usually located opposite the North Node symbol. The South Node represents your past experiences and tendencies that you may need to release or move away from in this lifetime.

How do you calculate the South Node in astrology?

To calculate the South Node in astrology, you need to know the date, time, and place of birth. The South Node is the point where the Moon's orbit intersects the ecliptic plane as it moves southward. It represents past experiences and patterns to be released or transformed in this lifetime. Astrologers use an ephemeris or computer software to determine the exact position of the South Node at the time of birth.

C program to print all combinations of a 4-digit number?

#include<stdio.h>

int main()

{

int a,b,c,d;

for(a=1; a<5; a++)

{

for(b=1; b<5; b++)

{

for(c=1; c<5; c++)

{

for(d=1; d<5; d++)

{

if(!(a==b a==c a==d b==c b==d c==d))

printf("dd\n",a,b,c,d);

}

}

}

}

return 0;

}

What are the main features of a compiler in C programming language?

A compiler is a comp. Program that transforms source code written in programming language into another comp. Language.the main reason to compile a program is to create an executable program...

What is thrashing in c?

Thrashing in C refers to excessive swapping of data between RAM and virtual memory, significantly slowing down the system due to the high overhead involved in managing memory. It typically occurs when a program doesn't have enough physical memory and constantly swaps data in and out of virtual memory.

Is the face recognition system an example of biometric device?

Althogh there there are better biometric devices, face recognition is an example of biometric device because it has to recognize your face to authenticate you to a facility.

What function will read a specified number of elements from a file?

The function fread() in C can be used to read a specified number of elements from a file. It takes as arguments the pointer to the buffer, size of each element, number of elements to read, and the file pointer.

What does the chemical formula C mean?

The chemical formula C represents the element carbon. Carbon is a non-metallic element commonly found in organic compounds and plays a crucial role in the chemistry of life.

What is the function of chromatids?

Chromatids are the two identical copies of DNA that make up a replicated chromosome. They are joined at the centromere and separate during cell division, ensuring each daughter cell receives an identical set of genetic information.

What is difference between Bac arrays and DNA arrays?

BAC (Bacterial Artificial Chromosome) arrays are a type of DNA arrays. BAC arrays are usually used for a technique called array CGH (Comparative Genomic Hybridisation) which is used to identify gross deletions or amplifications in DNA (which for example is common in cancer). DNA arrays include BAC arrays but also oligo, cDNA, and promoter arrays. Oligo and cDNA arrays are typically used for gene expression analysis (looking to see how heavily expressed each gene is). Oligo arrays can also be used for SNP (single nucleotide polymorphism) analysis. Promoter arrays are used to identify transcription factor binding sites.

What are the uses of the Inoculating Loop?

Inoculating loops are used to transfer microorganisms to growth media or for staining slides. They are an important part of the sterile technique as their use permits transfer only of the material of interest.

What does Tc 20 degrees celsius stand for?

To contain at 20 degrees celsius. To contain at 20 degrees Celsius. This would be written on a graduated cylinder or a volumetric flask.

What are the functions of indicators?

Indicator species are a useful management tool, and can help us delineate an ecoregion, indicate the status of an environmental condition, find a disease outbreak, or monitor pollution or climate change. In one sense, they can be used as an "early warning system" by biologists and conservation managers. Indicator species must also be accompanied by a thorough study of what is being indicated, what is really correlated, and how this one species fits into the rest of ecosystem.

What is the problem with floating inputs?

The problem with floating inputs is that electrical noise in the line could trigger the input without user input. This can easily be avoided with a pull-up or pull-down resistor. The problem with floating inputs is that electrical noise in the line could trigger the input without user input. This can easily be avoided with a pull-up or pull-down resistor.

How do you adjust the air pressure of a c pap machine?

You can't. It has to be adjusted by a technician working for the company who provided the machine to you, and only on the order of the physician. After all, an inappropriate pressure could be harmful to the patient. If you think your CPAP pressure is inappropriate, simply contact the physician who prescribed it and tell him or her.

What type of barbell can be used for a tongue piercing Is the plastic nickel free ones okay?

of course not free is always bad quality have you ever bought something cheaper because you thought it was just as good as the more expensive one and after a while it breaks right well with the same thing with a piercing the cheap ones or the free ones are always bad cause you end up swallowing the balls because they break because it plastic its better to get the surgical metal barbell with hard plastic balls they don't break but plastic balls you can swallow them i have a lot of experience in piercing and i know my piercings i have had a tongue piercing for almost a year now and i have changed them a lot and han many different kinds of piercings I never swallowed 1 though cause i buy the good ones but i have heard many stories of people swallowing balls before so I recommend to buy the good ones and also the complete surgical metal ones are not as good either cause sometimes you can end up biting it and it hurts a lot it can also end up breaking your teeth so get hard plastic not metal balls but get the metal barbell

What is GPS DGPS and the frequently used algorithm used in programming DGPS?

DGPS is one of two widely used methods to augment the accuracy of the GPS.

Most GPS chips will follow the NMEA standard so that is usually the preferred way of parsing both GPS and DGPS data. Check out the related links for a link to the NMEA GPS standard.