15,552 Topics

Member Avatar for
Member Avatar for kudakwashe.kadzungura

help me with a c program that inputs a year number and number of years,then to determine which of those years were leap years

Member Avatar for np complete
0
118
Member Avatar for rithish

#include <stdio.h> #include <stdlib.h> int fact(int); int main() { int n,total=1,i; printf("enter the series limit: "); scanf("%d",&n); total=total+n; for(i=2;i<=n;i+=2) { total=total+(pow(n,i)\fact(i)); } printf("%d",total); return 0; } int fact(int c) { int j=1; int facto=1; for(j=1;j<=c;j++) { facto=facto*j; } return facto; } my output should be like this 1+n+n*n\2!+n*n*n*n\4! the error …

Member Avatar for _avishek
0
97
Member Avatar for ronnel09

i just want to ask if you know a formula, or just VERY SIMPLE codes on how to compute days between two dates? i really don't have an idea on how to make it. thank you!

Member Avatar for rubberman
0
99
Member Avatar for bugstalker

Being an experience programmer (fortran and assembly), I decided to modernize my resume and tackle c. In the process, I learned that like other programming languages, there were many 'versions' of c. Several course books I read use the conio.h header file. I was looking for a substitute for conio.h …

Member Avatar for Ancient Dragon
1
1K
Member Avatar for _avishek

My understanding of the C language is that the same identifier cannot be reused. However, the code below compiles on GCC without complaints, even when using the "-Wall -pedantic" flags. Is there something that I am missing? Does the standard say anything about functions/macros having the same name as typedef'd …

Member Avatar for _avishek
0
232
Member Avatar for ronnel09

How can i do scanf's in just one line? because example first i will input a number then i will press enter then the cursor will go to the next line. how can i maintain the cursor in just one line? thank you

Member Avatar for deceptikon
0
228
Member Avatar for shanki himanshu

int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i);

Member Avatar for _avishek
-1
117
Member Avatar for ronnel09

i just wanna ask if can i format centered the outputs of turbo c? just like when you do in microsoft word. thank you!

Member Avatar for WaltP
0
294
Member Avatar for chandnigandhi
Member Avatar for np complete
0
176
Member Avatar for c_program_user

I am trying to pass a pointer to a 3D array to a function in which I want to access an array element using pointer arithmetic. Define the array: const unsigned char TS_list_string[2][2][3] = { "abc", "def", "ghi", "jkl", }; Define the function void process_ts(const unsigned char *T1) { unsigned …

Member Avatar for c_program_user
0
177
Member Avatar for kovacsakos

I have an array with a lot of numbers. How can I create intervals from these numbers?

Member Avatar for WaltP
0
135
Member Avatar for shanki himanshu

are these declaration same? const char *const s; char const *const s;

Member Avatar for sepp2k
0
58
Member Avatar for nabeelbhutto

any one help me how can i do this plz plz guyz help me don't say do it by your self i could'nt understand thats why i am asking from you if i know then why i ask i don't know thats why i am asking friends plz help me...!! …

Member Avatar for sfuo
0
728
Member Avatar for zeusprog

As usual I know I'm probably doing something stupid. I'm trying to write the program below but I seem to have handled my queue incorrectly. The problem could be in one of three places; the way i handle moving on to the next node, my addboard function or my printsol …

0
107
Member Avatar for kovacsakos

I would like to make a memory allocation: `(*matrix)[i]=(int*)malloc(sizeof(int)*sz);` But I have got an error message: Invalid operands to binary * What should be the problem?

Member Avatar for kovacsakos
0
175
Member Avatar for manishanibhwani

if I write the following code.. float a =1.3; double b=1.3; if(a>b) printf("hii"); else printf("hello"); the o/p comes hii...but if I change the values to 1.7 the output comes hello...can any1 explain the reason????if precision is to be taken into account then everytime double should be greater..

Member Avatar for rubberman
0
146
Member Avatar for I_m_rude

actually , I am solving a problem: A list is there in which infinite numbers(approx 1 lakh) are there, and i am reading one by one. At any point of time, I am asked to return the kth(it is given initally) minimum element from the elements read so far. my …

Member Avatar for sfuo
0
144
Member Avatar for maurya10
Member Avatar for Banfa
0
89
Member Avatar for riahc3

Hello Im posting this in C because Arena is highly influenced by C.... Im trying to open a file using fopen but I cant get it to work. Ive made the permissions on the file 777 (all) just in case but it doesnt work. Can someone please test that it …

Member Avatar for Ancient Dragon
0
127
Member Avatar for riahc3

Hello I want to run a command as sudo (to be especific open a file) but I dont want to run the entire program as sudo obviously. How do i do a fopen with sudo previlges? I dont mind hardcoding the password (eg, so it wont ask me for my …

Member Avatar for L7Sqr
0
146
Member Avatar for david.marduk.7

whenever i try to run my program it always has this error "In function mainrift" "syntax error at the end input" can someone help me. void mainrift() { int days = 1, choice = 0, gil = 20000, debt = 50000; int depgil = 0, phoenixdown1 = 0, elixiressence1 = …

Member Avatar for WaltP
0
456
Member Avatar for shanki himanshu

i am using strrev function and also included the header file string.h but i am getting the compile error **‘strrev’ was not declared in this scope**. what else is required?

Member Avatar for WaltP
0
2K
Member Avatar for ronnel09

Good day ma'am/sir, i just wanna ask how to add color in a just specific word? because i tried this one printf("You chose"); textcolor(RED); printf("RED"); but still the whole output is colored red. please help, THANKS!

Member Avatar for ronnel09
0
128
Member Avatar for milindchawre

This program displays decimal,hexadecimal & character equivalents int main(void) { int i = 0; for(i = 0; i < 255; i++) printf("Dec-%3d hex-%02x Char-%c\n", i, i, i); return 0; }

Member Avatar for DrunkenCoffin
0
162
Member Avatar for kovacsakos

How can I find the differences between two matrix? I should find the diverse numbers. Thanks in advance for your help!

Member Avatar for WaltP
0
124
Member Avatar for SHASHWATH

File program which gives output induntation code when we call that file actualy it was uninduntationed before

Member Avatar for WaltP
-3
145
Member Avatar for Vish0203

I have a little problem related to the white spaces in my program. Well, the actual program I'm trying to make is something else. so this program is just to check whether the text is properly broken or not. The problem I'm facing is, for the first word in my …

Member Avatar for Ancient Dragon
0
120
Member Avatar for milon.mahapatra
Member Avatar for milon.mahapatra
0
234
Member Avatar for I_m_rude

main() { char s[19]; strcpy(s,"\0"); if(s==NULL) printf("daniweb\n"); else printf("nitin\n"); return 0; } Can anyone tell me what is expected o/p of this and why ? help! thanks in advance.

Member Avatar for I_m_rude
0
138
Member Avatar for I_m_rude

hello, this is code to generate fibo numbers in log n time. it is giving o/p as "0", i dn't know where is error. please help. #include<stdio.h> int (*(fibo)(int m[][2],int p))[2] { int r[2][2]={0,0,0,0},d[2][2]={0,0,0,0}; int (*l)[2]; int i,j,k; if(p==1) return m; l=fibo(m,p/2); for(i=0;i<2;i++) for(j=0;j<2;j++) { r[i][j]=*((*l+i)+j); } for(i=0;i<2;i++) for(j=0;j<2;j++) for(k=0;k<2;k++) …

Member Avatar for I_m_rude
0
122

The End.