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 space and time Complexity of Fibonacci series algorithm?

There's more than one algorithms, the best one is the following:

F(n) = 1/sqrt(5) * (q1^n + q2^n)

where q1=(1+sqrt(5))/2, q2=(1-sqrt(5))/2

Write c programs to display 10 line biodata?

A C++ program can be used to write C programs that will display 10 lines of biodata. Many types of C programming can be written with a C++ program.

What is double in 'c' language?

The double data type is a fundamental numeric data type that can represent floating point values. Depending on implementation, it is normally 8 bytes in size, with a precision around 18 decimal digits.

Does C language has a interpreter?

There might be C language interpreters, but they have no or minimal importance in actual programming.

Backus-Naur-Form Grammar of C language variable declaration?

<stmt>::=<typespecifier><space><identifier>

<typespecifier>::=int|uint|char|byte|short|double|float

<space>::=" "

<identifier>::=<character>+

<character>::= <digit>|letter|_

<digit>::= 0|1|2|3|4|5|6|7|8|9

<letter>::=a|b|c...|z|A|B|C.....|Z

What is an example of how a modulus function works?

In mathematics, the modulus of a real number is its numerical value without regard to its sign. So, for example, 3 is the absolute value of both 3 and −3. When graphing a modulus function, f(|x|), graph the function f(x) ignoring the modulus and simply reflect any values below the x-axis (negative values) so they become positive.

What is c c sabathia's shoe size?

According to the article below, by Samantha Carr; he wears a size 15 shoe.

4/21/09) - Growing up, my older brother and sister used to tease me about having wide feet and stubby toes. In fact, they nicknamed me Franklin Stubbs after the 1980s Dodgers first baseman and outfielder. I can look back and laugh at it now, but I can't imagine how much teasing CC Sabathia took growing up.

This week, Sabathia handed over his cleats from Opening Day at Yankee Stadium to Hall of Fame President Jeff Idelson -- and in the process, broke a new record in Cooperstown.

Mary Bellew, assistant registrar at the Hall of Fame, assures me that at size 15, Sabathia's shoes are the largest ever in our collection, breaking Ryan Minor's mark of 13 ½. Minor donated the cleats he wore Sept. 20, 1998, when he took over for Cal Ripken Jr. at third base after Ripken decided to end his record-breaking streak of consecutive games played at 2,632.

We also have shoes from 6-foot-10 and five-time Cy Young-winner Randy Johnson, but he is only a size 13.

Jeff also brought back the bat Grady Sizemore used to hit the first grand slam in the new park and a game-used commemorative Opening Day baseball signed by winning pitcher Cliff Lee. They will be on display, along with Sabathia's cleats, in the Today's Game exhibit this summer

A menu driven program to convert a decimal number to binary octal and hexadecimal?

#include<iostream>

#include<conio.h>

using namespace std;

class conv

{

int x,b,r,arr[20],ch;

public:

void get()

{

cout<<"ENTER THE VALUE TO BE CONVERTED:(IN DECIMAL):";

cin>>x;

cout<<"ENTER BASE TO WHICH U WANT TO CONVERT:(UP TO BASE 18):";

cin>>b;

}

void convert();

};

void conv :: convert()

{

int i=0,j;

cout<<"-----------------CONVERSION PROGRAM------------------------\n";

while(1)

{

cout<<"-----------------------------------------------------------\n";

cout<<"1.CONVERT FROM DECIMAL TO OTHER\n2.QUIT\n";

cout<<"------------------------------------------------------------\n";

cout<<"ENTER UR CHOICE:";

cin>>ch;

switch(ch)

{

case 1:

get();

cout<<"IN BASE "<<b<<":";

while(x>0)

{

r=x%b;

arr[i]=r;

x=x/b;

i++;

}

for(j=i-1;j>=0;j--)

{

if(arr[j]==10)

cout<<"A";

else if(arr[j]==11)

cout<<"B";

else if(arr[j]==12)

cout<<"C";

else if(arr[j]==13)

cout<<"D";

else if(arr[j]==14)

cout<<"E";

else if(arr[j]==15)

cout<<"F";

else if(arr[j]==16)

cout<<"G";

else if(arr[j]==17)

cout<<"H";

else if(arr[j]==18)

cout<<"I";

else

cout<<arr[j];

}

cout<<"\n";

i=0;

break;

case 2:

exit(0);

default:

cout<<"WRONG CHOICE\n";

}

}

}

main()

{

conv obj;

obj.convert();

getch();

return 0;

}

How do you add a timer function to object in object oriented programming AS3?

http://theflashblog.com/?p=231

Basically create the timer, give it an event listener, and a function. Change your object using the function and start the timer.

Accept ten names and print the given names in opposite order using array of pointers?

#include<stdio.h> #include<string.h> #include<conio.h> void main() { int i; char a[10]; printf("enter ten names one by one"); for(i=0;i<=9;i++) { scanf("%s\n",a); } for(i=9;i<=0;i--) { printf("names are %s\n"); } getch(); }

How do you write a C-program to find range of a set of numbers?

#include<stdio.h>

#include<conio.h>

void main()

{

int x[10],r;

for(int i=1;i<=5;i++)

{

printf("enter the number");

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

}

r=x[5]-x[1];

printf("%d",r);

getch();

}

Write a C program to add an integer and a decimal number?

include <iostream>

using namespace std;

int main() {

int n; // number to convert to binary

while (cin >> n) {

if (n > 0) {

cout << n << " (decimal) = ";

while (n > 0) {

cout << n%2;

n = n/2;

}

cout << " (binary) in reverse order" << endl;

} else {

cout << "Please enter a number greater than zero." << endl;

}

}

return 0;

}//end main

What is meant by zero overhead loop?

the term zero over head looping means that the processor can execute loops without consuming cycles to test the value of loop counter , perform a conditional branch to the top of the loop and decrement the loop counter.

What is polish notation in data structure?

I don't find the answer of my question posted. Pleases send me the answer.

Ax-by plus c?

AX-BY+C cannot be simplified any farther because none of them are like terms. unless, of course, one of these variables had a definite value.

Find the level of a node in binary tree?

level of a node in any binary tree can be calculated by summing up the number of nodes traversed from the root node of the tree to the node whose level has to be calculated!!!! dats it!!

if count is the no. of elements passed, then floor(log2(count-1)) is the level

Write c program to print common elements from two given arrays?

#include<stdio.h>

int main ()

{

int size,a[100];

int i,j,k;

printf("Enter size of the array\n");

scanf("%d",&size);

printf("Enter elements of the array\n");

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

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

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

{

for(j=i+1;j<size;j++)

{

if(a[i]==a[j])

{

for(k=j;k<size;k++)

{a[j]=a[j+1];

size--;

}

}

}

}

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

printf("%d\t",a[i]);

return 0;

}

Write a function that accept 5 digit number and return the sum of it to main?

#include<stdio.h>

#include<conio.h>

int func(void);

void main(void)

{

clrscr();

printf("Enter five digit number: ");

printf("nnnSum of entered number is %d",func());

getch();

}

int func(void)

{

int b=0,a;

while((a=getche())!='r')

b+=a-=48;

return b;

}

Difference between circular and single linklist?

A regular linked list will have a pointer to the start of the list, with each node pointing to the next node, and finally the last node points to NULL. In a circular linked-link, the last node will point to the first node, making the list circular. This requires extra checks to ensure that you don't end up going into an infinite loop while traversing the list.

How to write a recursive void-function that has one parameter which is a positive integer When called the function writes its argument to the screen backward That is if the argument is 1234 it outputs?

I am a beginner at C++ but my professor gave us a similar one to this which was to display 4321. So i just modified it to fit your satisfaction.

Code:

void f(int n)

{

cout<<n;

if(n<=4) f(n+1);

}

calling statement: f(1) Output:1234

Trace :

f(1)

/ \

1 f(2)

/ \

2 f(3)

/ \

3 f(4)

/

4