-
-
Tricky C Program questions
1)Write a C program to find a peculiar two digit number which is three times the sum of its digits.2) Bacteria are known to multiply very rapidly. If a certain container contains just one bacterium on the first day and there are twice as many on the next day. In this manner the number of bacteria in the container doubles itself everyday. Assuming that the container would be full on the 10th day with...
-
TCS C/C++ Questions
1. Difference between "C structure" and "C++ structure".2. Diffrence between a "assignment operator" and a "copy constructor"3. What is the difference between "overloading" and "overridding"?4. Explain the need for "Virtual Destructor".5. Can we have "Virtual Constructors"?6. What are the different types of polymorphism?7. What are Virtual Functions? How to implement virtual functions in "C"8. What...
What is the difference between structure & union?
how can we multiply this A*B without using "*" operator?
Recursive function to compute the number of sequences of n binary digits.
How to Write a recursive function to compute the number of sequences of n binary digits that do not contain two 1s in a row. Write a main function to test this function. Input:Input consists of the number of binary digits in the sequence.Output:Output consists of the number of sequences of given binary digits that do not contain two 1s in a rowSample Input:Enter the number of binary digits in the sequence:5Sample...
Print printf without using printf
How to print printf without using printf in C program?
Big endian or Little endian
How will you find whether your system is following Big endian or Little endian representations. Write C code. In Little endian, the lowest byte is stored in lowest address.
In the following code, what is p2? typedef int* ptr ptr p1, p2;
A) an integer B) an integer pointerC) a pointerD) None of the above
Removing duplicate words from a string
cint main()
{
char arr[1000];
char *temp=NULL;
char *temp1=malloc(100);
int len;
printf("enter the string:
");
gets(arr);
len=strlen(arr);
puts(arr);
printf("len:%d
",len);
temp=strtok(arr," ");
if(temp!=NULL)
strcpy(temp1,temp);
while(temp!=NULL)
{
temp=strtok(NULL,"...Sum of two numbers without using arithmetic operators
Ex:int a=10;int b=10;int sum=a+b;without using "+" operator calculate sum
How to write a program for fibonacci series using perl?
Can someone help me in writing program for fibonacci series using perl..
Finding a number which is a power of 2in a single step
How to find whether the given number is a power of 2 in single step (without using loops)?
Ans