15,551 Topics
| |
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 … | |
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 … | |
im entering points in cartesian plane , how am i supposed to plot that points in my program | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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) … | |
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]); … | |
[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] | |
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 … | |
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 ?? | |
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); } … | |
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<<","; … | |
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 … | |
[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; … | |
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 … | |
| 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 … |
can anyone help me in writing a program for RAIL FENCE CIPHER in C lang?? | |
[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 … | |
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) | |
[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 … | |
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... | |
[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; … | |
I would like to access the name field from the array items and print the name but I am having trouble. I created a pointer 'L' in callInitialize and set it to the upper struct type List which I named 'studentList'. [code] int callInitialize () { /*Initialize a List*/ List … |
The End.