I just modified the prototype and it worked fine thanks yall^^
Type: Posts; User: Lissa
I just modified the prototype and it worked fine thanks yall^^
It prints all the words as not palindrome. I added the printf u said, and for those who actually are: it prints the actual length and (lenght-1). :s:s
I know this is what i tried to do but it doesnt seem to work:
int isPalindrome (char *str){
int length=strlen(str);
int i;
if (length<1)
return 1;
if (str[0] == str[length-1]){
...
Hi,
I have the following recursive implementation of a function that checks if a word is a palindrome. But i actually need it with this prototype (recursive as well) :
int isPalindrome(char...
printf("You have%d sisters and%d brothers\n", sisters, brothers)
thank you master5001 it works now, tabstop found out i just had to initialize sum_div correctly. thanks yall.
ohh thank youuuuuuuuuuu (k)
i think the pblm is with the for loops. but how do i initialize that each time?
Hi can anybody correct my code please?
/*Write an algorithm that gets a positive entire number N then displays all perfect numbers less or
equal to N.*/
#include<stdio.h>
int main...
um im actually done with this prog of displaying divisors. if you want i can show u the final piece of code that works well. now i got a problem with the second i sent u, i cant actually use arrays...
um master5001, i think you are using quite an advanced code, we havent reached arrays, yet, dont forget im just a beginner lol. i mean all what w've done so far is selective statements & loops...
i know how to write the code but it only displays the first divisors which is 1, now i want it to display them all
hey all i gotta write a programs that works like this:
---------------------------
Enter number: 12
Divisors: 1 2 3 4 6
---12 is Abundant
---------------------------
Can anybody...
btw thanks to yall who bothered themselves to help me, even though my pblm isnt solved yet^^.
wow.
o my bad cnt has to change. i just incremented it like cnt++
except for those which cant be divided by 2 actually
yess it works but it shows 2 as the only divisor for any number i enter
this is what i get
bundant), 2(Abundant), 2(Abundant), 2(Abundant), 2(Abundant), 2(Abundant), 2(Abu
ndant), 2(Abundant), 2(Abundant), 2(Abundant), 2(Abundant), 2(Abundant), 2(Abund
ant),...
yes but we already have a piece of executable file to which we have to stick
yes but we have a piece of executable file to which we have to stick
lol i know ur being veeery patient with me. im sorry im just a beginner :d:d
well i tried to compile ur code, it gave me a scary .exe, it's still running now btw while im writing u this. keeps...
that looks better. im using C free as a compiler and it's saying sth about C++ and ANSI and stuff like that. plus we haven't rlly done the for loop yet, and im suppose to do it with the while one.
...
ok here's the final thing. but the display of divisors is wrong.
#include <stdio.h>
int main (void) {
int n, cnt, sum_div;
char ans;
do{
...
*continue loop