18,490 Topics

Member Avatar for
Member Avatar for Snehamathur

[CODE] /* Any year is input through the keyboard. write a program to determine whether the year is a leap year or not. */ #include <stdio.h> #include <conio.h> void main(void) { int year; clrscr(); printf("\n\n enter a year::"); scanf("%d",&year); if(year%400==0) printf("\n\n Leap Year."); else if(year%100==0) printf("\n\n Not Leap Year."); else …

Member Avatar for stephen.beatson
0
409
Member Avatar for pavani2006
Member Avatar for swaar.metaal.7

Hi everyone, I am new here and I hope all of you are doing well. I have spent the whole day searching around on the almighty Google for code that can help me with my problem. In the following code there may be quite a few n00b mistakes, and for …

Member Avatar for swaar.metaal.7
0
299
Member Avatar for yann.bohbot.9

hey everyone! having a small problem with my pointer. I'm just trying to scan an array using a pointer but when i print it it shows me only zeros. Any help? #include <stdio.h> int main() { int arr[10]; int *ptr; int i; ptr = &arr[0]; printf("Enter 10 integers:\n"); for (i=0; …

Member Avatar for sepp2k
0
144
Member Avatar for Za3mi

Hello dear! I am going to develope a program that have an ability to make a plan for month of the medical information officers. I've tried it using c, c++ but i can't. Then i tried it using php and database as i have 190 doctors whom an MIO have …

Member Avatar for Schol-R-LEA
0
238
Member Avatar for it mansoor

write a program in c who get input from key board and then show the addition of numbers

Member Avatar for Deep Modi
-2
184
Member Avatar for glao

(Continued from [here](http://www.daniweb.com/software-development/cpp/threads/474128/column-major-not-shown-right#post2070227) ) I am trying to use column major order to a 2d matrix which I am using as 1d. int N=3,R=2; for (int i=0;i<N;i++){ for (int j=0;j<R;j++){ //printf("\nX[%d]=%d\t",i+j*N,res[i+j*N]); //column major // printf("\nX[%d]=%d\t",i*R+j,res[i*R+j]); //row major } printf("\n"); } but the column major doesn not work as it should. …

Member Avatar for David W
0
467
Member Avatar for murnesty

Hi, I'm looking for embedded system or os source code example. Just to learn some common error or good way to write some device process. Probably in C or C++. Is there any good suggestion?

Member Avatar for David W
0
255
Member Avatar for COKEDUDE

Can you please explain what this weird int declaration does. Here is the block of code. void show(void *u, int w, int h) { int (*univ)[w] = u; printf("\033[H"); for_y { for_x printf(univ[y][x] ? "\033[07m \033[m" : " "); printf("\033[E"); } fflush(stdout); } This is the line I'm talking about. …

Member Avatar for Ancient Dragon
0
292
Member Avatar for Jason_9

I'm totally new to programming and taking an intro class. When i prompt the user for a state code the program just exits, nothing in my book really goes over this and all im given is crappy youtube videos for reference. Any help is greatly appreciated. #include <stdio.h> #include <stdlib.h> …

Member Avatar for David W
0
289
Member Avatar for COKEDUDE

Can someone please explain what unistd.h does and the purpose of it? I have been googleing the last hour and I don't understand it.

Member Avatar for COKEDUDE
0
148
Member Avatar for churchill.omorere

Design a C program that will convert temperature values from degrees Celsius to degrees Fahrenheit. The user must enter a start and a finish value, together with a step value. The program must convert all temperatures beginning with the start value at the given step interval. Use the …for()… statement …

Member Avatar for BobS0327
-1
181
Member Avatar for jalferez1

i asked this on the C++ forum but someone told me to try it here on C. here's my first program there are some error with this program, i can't debug it. what's the problem? #include <stdio.h> #include <conio.h> #include <ctype.h> #include <string.h> int main(void) { int strlen, a, b,c; …

Member Avatar for jalferez1
0
231
Member Avatar for kalyan_1

Could some one help me out with the basics of Structures ? How to use them in C programs ? etc.. Thanx in advance.

Member Avatar for David W
0
151
Member Avatar for nitin1

hi, Can anyone suggest me the approach for finding the lcm of the n numbers? my approach: find the max of the n numbers and start dividing it by all numbers , if all are dividing it then print it, else take next multiple of the max number and repaet …

Member Avatar for ShapesInClouds
0
3K
Member Avatar for Tinnin

Hi all, I've bought the book "Objective-C Programming - The Big Nerd Ranch Guide" and I'm running through the beginning chapters which just regard C. I'm doing this on my laptop running linux as I don't have a Mac (yet). I'm having trouble with this code: #import <stdio.h> #include <readline/readline.h> …

Member Avatar for Tinnin
0
2K
Member Avatar for coding101

I need to create a scenario where all 65535 ports are open. I currently can open 1021 socket desciptors and bind to 1021 ports. If i spawn ~ 70 processes todo the same, i can achieve the goal, but performance is slow. I'm not interested in packet sniffing. How can …

0
83
Member Avatar for nyt1972

Hello, Hope this is the right place to post, I am a student and want to create an OS like DOS just for practice, I know functions, arrays, pinters, structures and file handling but dont know how to start writing an OS, please help me. Regards.

Member Avatar for imawesome511
0
4K
Member Avatar for kalyan_1

Having trouble understanding pointers . Could anyone please help me out ? thanx in advance.

Member Avatar for David W
0
149
Member Avatar for ajit.nayak

I am trying to create Menu Selection process.if SELECT button pressed once should display the Display parameter and if select button pressed twice should goes to Set_parameter window(Where we set parameter). once it is display parameter using up and down arrow Choose the Display window .But problem i am facing …

Member Avatar for Banfa
0
181
Member Avatar for john.kane.100483

Ok so I try to do it this program by myself and I can't do it mysfelf. Im a new to this programming stuff. So I came here to ask help. Hope you can help me. My prof gave me program that will convert any base to bae 10. "Conversion …

Member Avatar for JorgeM
0
115
Member Avatar for vibhu mishra

i have a c code for printing all permutation of string. I have a problem in understanding ,how recursion work in for loop and how backtracking is used in this code. Another question is that how stack work in recursion under for loop. my code--> # include <stdio.h> void swap …

Member Avatar for David W
0
474
Member Avatar for Member #153709

Hello I have downloaded a source code written in C. There I found a Makefile file . Can you tell me how to run that "makefile" file from command line ? thank you

Member Avatar for biswajit.jgec
0
813
Member Avatar for churchill.omorere

Design a C program to convert a decimal number to equivalent 8-bit binary number. Include code that will ensure that the input number is valid, i.e. that numbers 0 to 255 only are accepted. For example, the table below illustrates the process of converting the Decimal number 14 to equivalent …

Member Avatar for deceptikon
-1
116
Member Avatar for sykopwinx

write a program to take decimal number and to print equivalent character?

Member Avatar for Ancient Dragon
0
116
Member Avatar for niyasc

hei May I know how to handle dev cpp; It shows error even for simple programs which I had successfully run in turbo c 3.0

Member Avatar for Ancient Dragon
0
364
Member Avatar for b.moattar

a program to play Rush Hour. the board is supposed to look like this: -------- |GG...Y| |P..B.Y| |PRRB.Y> |P..B..| |O...TT| |O.FFF.| -------- then You may assume the user enters either upper-case or lower-case input, with or without intervening spaces. and The program ends when the red car touches the '>' …

Member Avatar for rubberman
0
276
Member Avatar for Kevin_7

I'm having trouble compiling a short amount of code to the "Hello World" programming and am needing assistance. This is the error message that I get: no input files C:\Dev-Cpp\My World\Makefile.win [Build Error] n\make.exe: *** ["Hello] Error 1

Member Avatar for Ancient Dragon
0
235
Member Avatar for ReaseySo

#include <stdio.h> Reverse Number In C Program int main() { int n, reverse = 0; printf("Enter a number to reverse\n"); scanf("%d",&n); while (n != 0) { reverse = reverse * 10; reverse = reverse + n%10; n = n/10; } printf("Reverse of entered number is = %d\n", reverse); return 0; …

Member Avatar for jnawrocki
0
507
Member Avatar for rocky2008

clrscr() is usually given after the declaration of all variables. If it is given before the declaration(of variables), the compiler points out an error. Why is this due to ? Will there be any problem in allocating the required amount of memory if at all clrscr() is given before the …

Member Avatar for Ancient Dragon
0
971
Member Avatar for Curious Gorge

I was thinking about a question I asked last week that someone answered very well. The person said that no program can interface with the hardware in the same was as the OS. That statement prompted another question and what better place to ask it than here, right? Well how …

Member Avatar for Curious Gorge
0
281
Member Avatar for kent.johnstone_1
Member Avatar for rubberman
0
301
Member Avatar for alyssa.wilkins.77

Hello, I have been trying to make a logical expression that would give me a certain output(Y) from the given inputs(ABCD). The directions are not specific in how I get the output just that I do not simplify the logical expression A B C D Y 0 0 0 0 …

Member Avatar for alyssa.wilkins.77
0
205
Member Avatar for Member #1100866

Now after learning some C -not so perfect- I want to know how to give my program some style like a button a background image ....etc I want to turn it into a real program with colors mouse interface and other things

Member Avatar for Ancient Dragon
0
73
Member Avatar for richkardmunga.hounarable

i just want to enter the world of programming but i didn't know from what i'm starting i took a short look in C also C++ and Java,i just want to get into this nice world

Member Avatar for rubberman
0
117
Member Avatar for Member #1021832

Hi everyone so I have started learning strings in c and I get a problem. I have been changing initialized strings to uppercase or lower case and its easy. But I am having some trouble changing user input to uppercase. Here is a simple program which will take user input …

Member Avatar for Ancient Dragon
0
194
Member Avatar for deven (emile)
Member Avatar for bogoreh

hi dear fellow i have tried to add structure array in my program and i had a few issue to add. please can anyone tell me how can i add a structure array in the following program #include <stdio.h> #include <stdlib.h> #include<string.h> #include<conio.h> struct books{ char name[22], book[25],date1[10], date2[10],id[7],bid[7]; } …

Member Avatar for bogoreh
0
303
Member Avatar for harshchandra

This program just demonstrate how a node can be added,deleted,searched,counted,and printed using Singly Linked List. An easy code to understand :)[code]////////////////////////////////////////////////////////////// ////////// -: Singly Link list :- ///////// //////////////////////////////////////////////////////////// /* reference : Understandng pointer though c - Y karnetkar. */ ////////////////////////////////////////////////////////// ////////// Programmer : Harsh chandra /////////// //////////////////////////////////////////////////////// # include<stdio.h> …

Member Avatar for hanumant113
1
869
Member Avatar for boomboombugsh

How do I show this output using for loop statement? 1 23 345 4567 Thanks in advance :)

Member Avatar for iqra liaquat
0
241
Member Avatar for haroon.khaliq

A computer program intended to be developed which allow creating,reading,updating and deleting student data,one student data comprises of the name,roll numbers and their grades. the version of this application should use text files to store the student data,the arrays structures should be used, this is the code i am trying …

Member Avatar for rubberman
0
171
Member Avatar for Prashant_3

i wanted to show the magic of a digit nine to my friensd in c so any one plz help me

Member Avatar for android9000
0
127
Member Avatar for Member #1021832

Hi I am learning strings in c. And I stumbled on this errors on Xcode. What I am doing wrong? #include <stdio.h> #include <string.h> int main(int argc, const char * argv[]) { char *colors[3][10] = {'\0'}; printf("\nEnter 3 colors separated by spaces: "); scanf("%s %s %s", colors[0], colors[1], colors[2]); //error: …

Member Avatar for Member #1021832
0
152
Member Avatar for Member #1042208

Hi guys, here is my code for sizeof() problem. #include<stdio.h> struct student{ char name[30]; int roll_no; float marks; }; int main(){ struct student s; printf("\nSize of Name: %d Bytes.", sizeof(s.name)); printf("\nSize of Roll No: %d Bytes.", sizeof(s.roll_no)); printf("\nSize of Marks: %d Bytes.", sizeof(s.marks)); printf("\nSize of S Total: %d Bytes.", sizeof(s)); …

Member Avatar for ddanbe
0
239
Member Avatar for seo2005

Hi, I would like to print the table of a number entered by the user like 2 *1=2 2*2=4 2*3=6 The code is [code=c]#include<stdio.h> #include<conio.h> main() { int i,num; printf("Enter any number"); scanf("%d",&num); for(i=1;i<=num;i++) printf("%d*%d=%d",num,i,num*i); getch(); }[/code] But this code is generating errors.

Member Avatar for Nehal512
0
705
Member Avatar for Member #1021832

Hi there y'all I have written a simple program that lets you roll a dice. So in one way I am passing this and in another I would like anyone capable of finding a bug, or check my code if I could have used less lines of code or Tell …

Member Avatar for ddanbe
0
171
Member Avatar for Member #1042208

Hello folks, here is my code with question in it. #include<stdio.h> int main(){ float c=10.0001; char *p; p=(char *)&c; // Casting is correctly done. What exactly is purpose of (char *) ? printf("%f", *p); getch(); return 0; } OUTPUT: ![7d924474e7b33ad0974a971ebce23576](/attachments/small/4/7d924474e7b33ad0974a971ebce23576.jpg "align-right")

Member Avatar for ddanbe
0
199
Member Avatar for chubbyy.putto

I am trying do this pratice but some how the 2nd function did return. P.S>>Since english is my first lang. can some one explane to me this is right path that i am doing? here is question: Write a function that accepts an array of integers and its size as …

Member Avatar for Banfa
0
232
Member Avatar for Member #1042208

Hi guys, here is my code that am working on this morning, and I came across a point when pointer operation went wrong. #include<stdio.h> int main(){ char a[20]="Hello World !!!"; char *ptr=a; FILE *p; p=fopen("new.txt", "w"); int i; for (i=0; *ptr != '\0'; i++){ fprintf(p,"%c", ptr[i]); } fclose(p); getch(); return …

Member Avatar for Member #1042208
0
212
Member Avatar for Dri Tan

#include <stdio.h> #include <stdlib.h> #include <stdio.h> #inculde <stdlib.h> typedef struct elementi{ int data; typedef struct *next; }lista; lista*putel(lista *l,int x){ lista*tmp; tmp=new elementi; //How can i put a new element? tmp->data=x; tmp->next=l; tmp=l; } . . . (continue)

Member Avatar for Ancient Dragon
0
59

The End.