15,552 Topics

Member Avatar for
Member Avatar for bobytch

Good Day Everyone here is my code so far [CODE] #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> void vp(int x,int tc,int bk,char *text); void square(int x,int y,int size); void main() {//=========================================================== int gdriver = DETECT, gmode, errorcode; initgraph(&gdriver, &gmode, "C:\\TC\\BGI"); //------------------monitor-------------------- setbkcolor(0); setcolor(15); square(300,160,150); square(300,160,148); square(300,160,130); square(300,160,131); setaspectratio(2,5); int …

Member Avatar for vidit_X
0
281
Member Avatar for linux

This is for a CS course I am taking. I'm stuck. I need to write a program that takes a number and tallies up how many cycles it takes of multiplying the digits until it is a single digit number. ie: 715 = 7 * 1 * 5 = 35 …

Member Avatar for linux
0
119
Member Avatar for bckc

Hi guys, I started learning C a few days ago, watching as many youtube tutorials as possible but there aren't many tuts on youtube :/ Can anyone recomend me a good book or list of tutorials? I started to read "The C Programming Language" by dennis ritchie but It's a …

Member Avatar for cse.avinash
0
176
Member Avatar for theCompiler

im entering points in cartesian plane , how am i supposed to plot that points in my program

Member Avatar for Ezzaral
0
69
Member Avatar for Master Mascus

[CODE]// Including the libraries to be used #include <stdio.h> #include <stdlib.h> #include <string.h> // Defining the End of line #define EOL '\n' //Declaring Global variables (for the sentence and the output sentence- final) char sentence[100]; char final[100]; int i,j,ans; int start() // Defining the start function { printf ("\n"); printf …

Member Avatar for Narue
0
124
Member Avatar for niyasc

Following is the code written to implement a employ manipulation system using pointer to structures . It makes some allocation problem in dev-cpp while work well in turbo c. Can you help me to understand the problem[CODE] // Implement pointers to structures to produce employ manipulation and produce output //as …

Member Avatar for Narue
0
185
Member Avatar for vedro-compota

hi guys) please tell me - why the Turbo C show the error - [QUOTE]LINE_MAX is undefined [/QUOTE] for code = [CODE]/* */ #include <stdio.h> #include <alloc.h>/* */ #include <stdlib.h> #include <limits.h> main() { char a=''; char * ch; char * inputstr; printf("\nPlease specify the input string \n"); / fgets …

Member Avatar for vedro-compota
0
2K
Member Avatar for cpu-guy

Hi I have a assignment about formatting C this is the assignment print_patterns(int i, double d) - Print 10 lines as specified below. * Lines 1 and 2 are fixed patterns with 20 characters each. * Line 3-6 are for integer i (sample value 123). * Line 7-10 are for …

Member Avatar for cpu-guy
0
165
Member Avatar for lastbencher
Member Avatar for maybnxtseasn

The following was produced by my decompiler of some disassembly DWORD v4 = *(_DWORD *)(*((_DWORD *)&dword_8EF798 + a2) + 1020); i dont understand how the & changes the above pointer dereferencing. Can you explain the different in interpretation of *(_DWORD *)(*((_DWORD *)&dword_8EF798 + a2) + 1020); vs. *(_DWORD *)(*((_DWORD *)dword_8EF798 …

Member Avatar for Narue
0
68
Member Avatar for lastbencher

I was trying to print the location of array elements using the following code [code=c] #include<stdio.h> main() { int arr[]={10,20,30,40,50,60}; int i; for (i=0; i<6; i++) printf("%d ", &arr[i]); return 0; } [/code] Error: [B]printArrayLocation.c:7:3: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘int *’[/B] While i …

Member Avatar for Narue
0
168
Member Avatar for phileyofish

Hello, I'm very new to programming and I am working on a program to test to see if a random number is prime. This is what I have so far. I'm really stuggling with the logic of it. I understand what I have up to the while loop. I'm pretty …

Member Avatar for Adak
0
110
Member Avatar for chubakueno

I have read [URL="http://bytes.com/topic/c/answers/891582-radio-button-groupbox-not-generating-wm_command"]http://bytes.com/topic/c/answers/891582-radio-button-groupbox-not-generating-wm_command[/URL] but when I try: [CODE] hwndFrame = CreateWindow( "BUTTON", "Test", WS_CHILD | WS_VISIBLE | BS_GROUPBOX | WS_CLIPCHILDREN, 304, 112, 233, 63, hwnd, NULL, g_hInst, 0); if(hwndFrame == NULL) return 0; hwndBtnCerrar = CreateWindow( "BUTTON", "Close", WS_CHILD|WS_VISIBLE|WS_TABSTOP, 20, 20, 103, 17, hwndFrame, (HMENU)IDBTNCERRAR, g_hInst, 0); if (hwndBtnClose …

0
136
Member Avatar for niyasc

[CODE] #include<stdio.h> #include<conio.h> #include<malloc.h> int main() { int i=0,j=0,n=0; char *a,**b; a=(char *)malloc(sizeof(char)*50); printf("Enter your text\n"); gets(a); while(a[i]!='\0') { *(b+n)=(char *)malloc(sizeof(char)*20); //error for(j=0;a[i]!=' ';i++,j++) { *(*(b+n)+j)=*(a+i); } i++; n++; } printf("Words in given text are \n"); for(i=0;i<n;i++) { puts(*(b+i)); printf("\n"); } printf("Possibile combinations are \n\n"); for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(j!=i) …

Member Avatar for niyasc
0
249
Member Avatar for ryanfsf

i want to ask something about my assignment. heres the code [CODE]#include <stdio.h> int main() { int nilaiuts[5],nilaiuas[5],nilaitugas[5]; int i; float total=0; printf("Masukkan nilai UTS mahasiswa [5 mahasiswa] :\n"); // proses memasukkan data ke array for (i = 0; i < 5; i++) { printf("Mahasiswa %i : ", i+1); scanf("%i",&nilaiuts[i]); …

Member Avatar for WaltP
0
220
Member Avatar for monica sri

[CODE]#include<stdio.h> int main() { printf("hai;"); return 0; } when i compile this using dev c++ i get a error message as [build error][project.exe]error1 [/CODE]

Member Avatar for neeraj goswami
0
102
Member Avatar for chezkaty

can you please help me again to this?:( cause the previous one I've asked to you i didn't get it :(( write a program that determines whether a given positive integer is an armstrong number. -----armstrong number is an n-digit number that is equal to the sum of the nTH …

Member Avatar for Anirudh Rb
0
115
Member Avatar for Master Mascus

The random function, generates the same values each the time program is run.. Any other function to output random numbers, each time the program is run ??

Member Avatar for Narue
0
155
Member Avatar for lastbencher

The following code is given in my Data Structure reference book. [code=c] #include<stdio.h> main() { int i, *pi; float f, *pf; pi = (int *) malloc(sizeof(int)); pf = (float *) malloc(sizeof(float)); *pi = 1024; *pf = 3.14; printf("an integer = %d, a float = %f", *pi, *pf); free(pi); free(pf); } …

Member Avatar for lastbencher
0
153
Member Avatar for Shodow

can u help me convert the cout to printf..i dont have a clue how.. tnx [CODE]#include<iostream.h> #include<string.h> #include<conio.h> int findSimilar(char[],char[]); void checkValue(int,int); int main(){ char boy[50]; char girl[50]; int similarInBoy=0; int similarInGirl=0; int total; clrscr(); cout<<"Enter Boy's Name: "; cin.getline(boy,50); cout<<"Enter Girl's Name: "; cin.getline(girl,50); similarInBoy=findSimilar(boy,girl); similarInGirl=findSimilar(girl,boy); total=similarInGirl+similarInBoy; cout<<"Boy: "<<similarInBoy<<","; …

Member Avatar for Narue
0
551
Member Avatar for lastbencher

This code is not running. i'm using gcc [code=c] #include<stdio.h> int main() { struct book { char name[10]; float price; int pages; }; struct book b[5]; int i; for (i=0; i<5; i++) { printf("Enter name, price and pages\n"); scanf("%c %f %d", &b[i].name, &b[i].price, &b[i].pages); } for (i=0; i<5; i++) printf("%c …

Member Avatar for lastbencher
0
123
Member Avatar for Shodow

[B]BEFORE[/B] [IMG]http://www.daniweb.com/forums/attachment.php?attachmentid=22439&d=1317523788[/IMG] [CODE]#include<iostream.h> #include<string.h> #include<conio.h> int findSimilar(char[],char[]); void checkValue(int,int); int main(){ char boy[50]; char girl[50]; int similarInBoy=0; int similarInGirl=0; int total; clrscr(); cout<<"Enter Boy's Name: "; cin.getline(boy,50); cout<<"Enter Girl's Name: "; cin.getline(girl,50); similarInBoy=findSimilar(boy,girl); similarInGirl=findSimilar(girl,boy); total=similarInGirl+similarInBoy; cout<<"Boy: "<<similarInBoy<<","; checkValue(similarInBoy,1); cout<<"\n"; cout<<"Girl: "<<similarInGirl<<","; checkValue(similarInGirl,2); cout<<"\n"; cout<<"Total: "<<total<<","; checkValue(total,3); cout<<"\n"; getch(); return 0; …

0
63
Member Avatar for cdn88

I have an issue that's really confusing me... Below I am calling an initialize function: [CODE] void Initialize (List *L) { char* initialize = "initialize"; int i; for (i=0; i<MAXLISTSIZE; i++) { strncpy(L->items[i].name,initialize,MAXNAMESIZE); L->items[i].name[MAXNAMESIZE - 1] = '\0'; L->items[i].grade = 0; } L->count = 0; } [/CODE] And it seems …

Member Avatar for gerard4143
0
1K
Member Avatar for BobTheLob

Hey guys. I'm working on a project where a parent process forks two children (so Process A is parent to both Process B and Process C). I need the children to write to the pipe so that the parent can see it. When I make a simple one child pipe …

Member Avatar for BobTheLob
0
821
Member Avatar for sadiya

can anyone help me in writing a program for RAIL FENCE CIPHER in C lang??

Member Avatar for Adak
0
217
Member Avatar for theCompiler

[CODE]#include<graphics.h> #include<conio.h> int main() { int gd = DETECT, gm; int x1=50,y1=50,x2=200,y2=100; initgraph(&gd, &gm, "C:\\TC\\BGI"); setcolor(9); line(x1,y1,x2,y2); getch(); closegraph(); return 0; }[/CODE] here's my code in drawing a simple line in C . but it has errors it said that "undefined symbol _closegraph in module LINE.cpp (LINE is the name …

Member Avatar for D33wakar
0
669
Member Avatar for mail2shrid

If i'm scanning from keyboard using getch(), how do i check which arrow key has the user pressed??(Arrow keys have ASCII values same as some other keys so we can't directly check for ASCII values)

Member Avatar for ashok1514
0
4K
Member Avatar for fullarmorzz

[CODE]#include<stdio.h> #include<conio.h> main() { char c; printf("Enter the code for the chart: \n"); do { scanf("%c",&c); switch (c) { case 'A':printf("Area Chart\n");break; case 'B':printf("Bar Chart\n");break; case 'U':printf("Bubble Chart\n");break; case 'C':printf("Column Chart\n");break; case 'N':printf("Cone Chart\n");break; case 'Y':printf("Cylinder Chart\n");break; case 'D':printf("Doughnut Chart\n");break; case 'L':printf("Line Chart\n");break; case 'I':printf("Pie Chart\n");break; case 'P':printf("Pyramid Chart\n");break; case …

Member Avatar for ashok1514
0
130
Member Avatar for braindope

guys pls help me to creat a progam using array that will display the ff sequence 1,1,2,3,5,8,13,21,3,55 after displaying the fibonacci series tha program will ask for an array psition & will display its corresponding value this is done continnously... please...

Member Avatar for ashok1514
0
117
Member Avatar for fullarmorzz

[CODE] #include<stdio.h> #include<conio.h> main() { char c; printf("Enter the code for the chart: \n"); do { scanf("%c",&c); switch (c) { case 'A':printf("Area Chart\n");break; case 'B':printf("Bar Chart\n");break; case 'U':printf("Bubble Chart\n");break; case 'C':printf("Column Chart\n");break; case 'N':printf("Cone Chart\n");break; case 'Y':printf("Cylinder Chart\n");break; case 'D':printf("Doughnut Chart\n");break; case 'L':printf("Line Chart\n");break; case 'I':printf("Pie Chart\n");break; case 'P':printf("Pyramid Chart\n");break; …

Member Avatar for ashok1514
0
151

The End.