** filename: liar.c
*/
#include <stdio.h>
#include <stdlib.h>
int liar_liar(int);
int main(void) {
int n = 1;
int func = 0;
Type: Posts; User: return0
** filename: liar.c
*/
#include <stdio.h>
#include <stdlib.h>
int liar_liar(int);
int main(void) {
int n = 1;
int func = 0;
I need to see a recursive program in C that determines a sequence of numbers called the Liar Liar numbers.
Liar Liar numbers are a sequence of negative numbers in which each number is two times...
Hi all, I am running a little business on the side and was wondering of anyone knew of a program I could use that will show me the balances of clients after withdrawals, deposits. For example, if i...
so would i need to add a strcmp function after asking the user to enter the metal type, then compare their input to each of the metal types using an if else statement until it is compared to the...
int Q[7];
int P[7];
char* T[20];
int q1=0;
int p1=0;
can those be used with C as well?
#include <stdio.h>
#include <string.h>
int main(){
char string1[20];
int i, length;
int flag = 0;
printf("Enter a string: ");
scanf("%s", string1);
length = strlen(string1);
i had this part working earlier but i changed some stuff and now i cant figure out how to get this part to work correctly again. i know its a simple problem but i guess im just burnt out because i...
got everything working now ignore the post below too
not really complaining, i came here with a problem seeking help to fix it, after all isnt this what this website is for? as for the fgets and sscanf, we havent learned those yet so i cant use those...
Yeah when i run it and enter a wrong number it will keep saying Wrong number. Please try again! I need it to say that and then prompt the user to type the number in again until they type one that...
anybody know what i need to do to get rid of the infinite loop?
do
{
printf("Enter the number of tests:");
scanf("%d", &test);
if (test< 0 || test> 4)
printf("Wrong number....
#include<stdio.h>
#include<string.h>
int main(){
char str[50];
char *rev;
printf("Enter any string : ");
scanf("%s",str);
rev = strrev(str);
printf("Reverse string is : %s",rev);
Does anyone know how to make it so an output for a program would print out the string in reverse/backwards? I was just curious on how to do this. Thanks!
Hey guys here is what I got for my program :
#include"stdio.h"
int x[15],used[15]; int adj[15][15]={0}; int path[15][15],wght[15];
Oh I did not know wiki had a page for it. Would you mind linking it to me? I'd like to read up on it. I probably should have posted this on my former post sorry forgot about that one.
Hey guys I was a little confused on what the output is supposed to be on this program I didn't really understand it in the directions. Can anyone please explain it to me better if you understand it?...
Hey guys, I was wondering how difficult of a Program this is and around how much time it would be expected to complete it.
Traveling Salesperson Problem
We have talked about...
nvm i figured it out by using a do while loop.
int calc1;
printf("How many times to perform the calculation (2-5): ");
scanf("%d", &calc1);
if (calc1<2 || calc1>5)
printf(The value is out of range. Please try again.)
If the user...
actually when i enter a weekday it says invalid day entered too for some reason i cant figure out how to fix it.
it seems its not registering the else if statements after
if (day == 'S'...
yeah heres what i have with the correction and the added curly bracers.
#include <stdio.h>
int main () {
char S, M, T, W, R, F, A, day;
int hour;
yeah heres what i have with the correction and the added curly bracers.
#include <stdio.h>
int main () {
char S, M, T, W, R, F, A, day;
int hour;
oh yeah i forgot about that thanks. i fixed that but i cant figure out the error in line its all the same error it says
Can anyone tell me whats wrong with my code? It has some syntax error in line 22,24 and 26 and when theres no syntax error it says its the weekend no matter what i type.
#include <stdio.h>...