Forum: C May 18th, 2007 |
| Replies: 13 Views: 3,358 I can't get it! I tried using the code u gave ,making a few changes but only the last character of the last word gets printed! Plz help! :( |
Forum: Geeks' Lounge May 18th, 2007 |
| Replies: 33 Views: 4,020 Right you are. But she was going to get only a 45 day jail term and now even that has been reduced to half citing 'good behaviour' on her part. All this after pictures of her smoking a joint were... |
Forum: C May 18th, 2007 |
| Replies: 13 Views: 3,358 #include<stdio.h>
#include<string.h>
char reverse(char *ptr,int length)
{
if(*ptr=ptr[0])
return ptr[0]=ptr[length-1];
if(*ptr!='\0')
return reverse(ptr+1,length-2);
}
int main(void) |
Forum: C May 18th, 2007 |
| Replies: 10 Views: 2,431 |
Forum: Geeks' Lounge May 18th, 2007 |
| Replies: 435 Views: 29,086 I whole heartedly agree with that [:)]
But point in question is, does that really happen(mercy passing)? |
Forum: C May 18th, 2007 |
| Replies: 10 Views: 2,431 are these following points differences?
Repition
iteration:explicit loop
recursion:repeated function calls
Termination
Iteration:when condition fails
Recursion:when base case is recognized |
Forum: C May 18th, 2007 |
| Replies: 13 Views: 3,358 Q.Using recursive function,reverse a string.
Solution I tried
#include<stdio.h>
#include<string.h>
char reverse(char *ptr,int length)
{
return ptr[0]=ptr[length-1]; |
Forum: C May 18th, 2007 |
| Replies: 10 Views: 2,431 So what would one cite as the main difference(if any) between iteration and recursion? |
Forum: C May 17th, 2007 |
| Replies: 10 Views: 2,431 >>only one loop can be used ever and it can't be placed in a function.
I didn't understand what you meant by that.Why can't it be placed in a function? |
Forum: C May 17th, 2007 |
| Replies: 10 Views: 2,431 A loop can repeat a series of instructions only if each iteration immediately follows the previous one right? But in case of recursive functions, you can call the function at any point of the program... |
Forum: C May 17th, 2007 |
| Replies: 10 Views: 2,431 I want to know when it is necessary to include a return statemnt in one's code and also what is the difference between recursion and iteration? |
Forum: C May 16th, 2007 |
| Replies: 2 Views: 674 You should post your problem and the code you tried right here. Why else is this called a forum? Don't worry, there a lot of people who'll help you.So post asap. |
Forum: C May 16th, 2007 |
| Replies: 2 Views: 1,564 Q.Write a program to input data in an array.Compute the sum and average.Then count the number of values greater than the average and lesser than the average.Print the average,sum and the two counts.... |
Forum: C May 9th, 2007 |
| Replies: 4 Views: 3,943 I got it! Thanx a lot joey and aia! :) |
Forum: C May 8th, 2007 |
| Replies: 4 Views: 3,943 Q. WAPC to read a string into an aaray and capitalize the first character of every word in the input.
Solution I tried
#include<stdio.h>
int main(void)
{
char string[50];
char *ptr; |
Forum: C May 8th, 2007 |
| Replies: 36 Views: 7,488 Oh God! A lot of arguing and proving goin on here..Neways I figured it out guys.Thnx neways! |
Forum: C May 4th, 2007 |
| Replies: 36 Views: 7,488 First of all , it is a C program so I am not using cin and cout. Abt codetags, i tried using them but it didn't happen..tht explains the extra pair of brackets. Abt the question I asked it was "Do... |
Forum: C May 3rd, 2007 |
| Replies: 36 Views: 7,488 Q.Create an equivalent of four function calculator. The program should request the user to enter two numbers and an operator. It should carry out specified arithmetic operation on the two numbers(... |
Forum: C Mar 22nd, 2007 |
| Replies: 14 Views: 2,101 Thnx fox,joey,aia,sos...appreciate it! |
Forum: C Mar 21st, 2007 |
| Replies: 14 Views: 2,101 Thnx for the suggestions.That function would do just fine but I have to do it without using pre defined fucntions or methods. Was what I did even remotely right??? |
Forum: C Mar 21st, 2007 |
| Replies: 7 Views: 1,323 Which other fucntion can I use instead of gets to accomodate a string with spaces? And when I use getchar() in my compiler, it does not accept the input and so does not proceed with the code. |
Forum: C Mar 21st, 2007 |
| Replies: 14 Views: 2,101 Q.Write a function to accept a main string, one search string and one replace string. Replace the first occurence of search string in main string by replace string{assume the length of search and... |
Forum: C Mar 21st, 2007 |
| Replies: 8 Views: 14,996 Hey I got it..i did it differently though..thnx neways :) |
Forum: C Mar 19th, 2007 |
| Replies: 4 Views: 729 Ya git it!! Thnx a lot!!!! |
Forum: C Mar 19th, 2007 |
| Replies: 4 Views: 729 I made the following changes
[inlinecode][/inline code]
{
#include<stdio.h>
#include<conio.h>
void main()
{
int array[5],low,high;
int i=0; |
Forum: C Mar 19th, 2007 |
| Replies: 4 Views: 729 Q.Write a function to accept upto 25 numbers and display highest and lowest number along with all the numbers.
Solution I tried
#include<stdio.h>
#include<conio.h>
void main()
{
int... |
Forum: C Mar 19th, 2007 |
| Replies: 8 Views: 14,996 Q.Write a function to concatenate to input strings into one large string and display the result.
I know how to do this using strcat but not without it. Also can't use pointers. Please help!! |
Forum: C Mar 19th, 2007 |
| Replies: 7 Views: 1,323 Thanx for the help but the problem is my complier doesn't do too well with getchar and gets. I tried doing that but it didn't work. |
Forum: C Mar 18th, 2007 |
| Replies: 7 Views: 1,323 Q.Write a function to accept 20 characters and display whether each character input is a digit, lower case letter or upper case letter.
Solution I tried
#include<stdio.h>
#include<conio.h>... |
Forum: C Feb 27th, 2007 |
| Replies: 21 Views: 26,015 Thanks so much.It worked. Yeah I know that it is always int main with a return 0 and about indentation, i was so harassed that time that I didn't care. Thanx anyways. |
Forum: C Feb 26th, 2007 |
| Replies: 21 Views: 26,015 Yeah this works.But my problem is that I am not allowed to use islapha function since its not been taught yet. I have to do my assignment without using functions from cstring.h:rolleyes: :sad: So... |