15,539 Topics
| |
Hello i need to write a program read a text file and store the data with text in the format of : name 14 6 name2 15 26 However i cannot use fopen() scanf() getline() or fgets(), it has to be done with only open() read() and strtok() i have … | |
1)w.a.p. in c language that accepts a file as input and prints the no. of words in it. 2)w.a.p. in c language that accepts a file as input and converts all alphabetic characters in it to upper case. 3)w.a.p. in c that accepts a string and prints the list of … | |
What is the error in this simple code: [CODE]#include <stdio.h> int main() { char a[100]; int c; int i = 0; int x = 0; while( ( c = getchar() ) != '\n' ) { a[x++] =c; } a[x] = '\0'; while( ( a[i] != '\0' ) || ( a[i] … | |
A simple program to calculate permutations of a string using recursion, I have used a malloc string of size 100 , you can change it to whatever value you want. The author is currently working at Microsoft,any questions can be directed to [email snipped] | |
hi this is a course work question and i have tried multiple methods to get it to work so if you can show me where i'm going wrong i would greatly appreciate it. i have to read a 4 character input and create each of the numbers into a sort … | |
i have downloaded pdcurses and installed it. and , right now i am studying a ncurses tutorial , [url]http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/intro.html[/url] there are some sample examples also. but, when i try to compile "form" code examples , i see that there are no <form.h> header file in the pdcurses installation. has, anyone … | |
Hi friends, I need to make a simple parser for parsing PHP files (classes, functions et al) and I have read both Flex and Bison manual. I have read somewhere that I must build Abstract Syntax Tree (AST) and utilize that. But I cannot find any tutorial on how to … | |
Dear all, how can i make a program that count the different words in a text(input stop with EOF) and the number of the lines which a word appears? | |
Hi, i am making a text editor with mouse programming.Given is my code .the compiler is not giving any error but i am unable to use enter,delete,backspace and arrow keys . can any one please tell me the logic with which i can make my project more better. THANKS in … | |
[CODE]#include<stdio.h> #include<conio.h> int main() { FILE *p,*p2; char c; long l; long x; p=fopen("file1.txt","w"); printf("enter the content of file:"); while(c=getchar()!=EOF) { putc(c,p); } fclose(p); p=fopen("file1.txt","r"); // l=fseek(p,1L,2); l=ftell(p); p2=fopen("file2.txt","r"); c=getc(p); while(l!=-1) { if(c==' ') { x=ftell(p); // fseek(p,-1L,1); while(c=getc(p)!=' ') { putc(c,p2); fseek(p,-2L,1); } // fseek(p,x+1,0); } fseek(p,x,0); l=ftell(p); c=getc(p); … | |
I have a menu: [code] #include <exec/types.h> #include <intuition/intuition.h> #include <libraries/gadtools.h> /* Prototypes for system functions. */ #include <proto/exec.h> #include <proto/intuition.h> #include <proto/gadtools.h> /* ANSI C includes. */ #include <stdio.h> struct IntuitionBase *IntuitionBase = NULL; struct Library *GadToolsBase = NULL; struct NewMenu window_menu[] = { { NM_TITLE, "Project", 0 , … | |
Hi guys i have a problem with my code :[CODE]#include<stdio.h> #include<string.h> #include <stdlib.h> #include <conio.h> struct blahblah { char id[11]; char name[30]; float gpa; }lol[100]; int main(){ int count = 0; char name [50][100] ; for(int i =0;i<=4;i++){ printf ("Student %d\n",i+1); printf ("ID: "); gets(lol[i].id); printf("Name: "); gets(lol[i].name); printf ("GPA … | |
Hi, do you know why my output does not working properly.. Actually my output should looping,but it straightly ending the program.. [CODE]#include<conio.h> #include<stdio.h> int main () { int choice = 0 ; while ((choice>=1)&&(choice<=5)) { printf ("\nPlease Choose No 1 , 2 , 3 , 4 , 5\n"); printf ("Enter … | |
Hello do you know why my output not looping ? Even I already use "do" to make this code for looping.. [CODE]#include <stdio.h> #include <conio.h> int main () { int hari; double duit; do { printf ("Mari rent kerete..."); printf ("\nkalau 1 hari = 100"); printf ("\nkalau 2-4 hari = … | |
im wrote a program to determine weather a triangle is scalene, isosceles or equilateral based on the given side lengths...its not working properly..i.e its giving isoceles when i enter data for an equilateral...etc etc... i fugured it was my logic in writing the program that was missing something....could anyone tell … | |
[CODE]int a[10][20][30][40]; int *p[/CODE] How to access an element of a using p? .... PLs provide the actual code for the solution | |
Hi, i want to make a program that lets the user input as many numbers as they like and terminates when the user enters "EXIT" and prints the largest & smallest input, heres my code: [CODE]#include<stdio.h> #include<string.h> #include <stdlib.h> int main (){ int input; int min,max,a=0; char exit[] = "EXIT"; … | |
Program 66: Tromino Tiling An N x N (where N is a power of two) chessboard can be tiled with L-shaped tiles that cover three squares so that any given square and only that square is left uncovered. Assume that the rows of the board are numbered from one to … | |
i have a project(sort of) where i have to write a c programto take in user inputs and store it into a mysql database for future retreival. now, i have written the program for console mode. ie it asks the user [quote]please enter a name [/quote] and then the name … | |
Can anyone pls explain the output for this [CODE=c] int main() { int i=10; printf("%d %d %d",i++,--i,i); return 0; [/CODE] according to me the o/p should be 9 9 10 however gcc compiler is giving o/p is 9 10 10 can anyone explain me this.... | |
Well, hello. I have a problem with reading data from binary files into arrays. For example, let's say that we have d.bin file which contains pairs of strings with max lenght of 32 chars and double values like this: string12.334343 AS34.34 something3 where the string always takes up 32 bytes. … | |
Who can calculate tax in C using Control Statement, Arrays, Functions and Pointers... if you are so good show me what you Got... | |
Hi, Im doing a testing for taking the previous values of dbgname and export the values to the new variable (CDUMAPDBGNAME_NEW), but it doesn't output the value when i do the echo $CDUMAPDBGNAME_NEW statement. Anyone can help me on this? #include <stdio.h> #include <string.h> main (int argc, char **argv) { … | |
Just what is wrong with this simple code of mine? [CODE]#include<stdio.h> #include<string.h> #include<stdlib.h> main() { int i=0, num; char a[8]; char keyword[8]; system("cls"); while(i<8) { num = rand()%3; if ( num == 0 ) a[i] = 65 + rand()%26; /* 65 is the ascii value of A */ else if … | |
is it possible to make scanf not go into a newline after printf? [CODE]#include <stdio.h> #include <conio.h> int main(){ int a; scanf("%d",&a); printf ("%d",a); getch(); }[/CODE] output(suppose a is 5) :[CODE]5 5[/CODE] i want to print them in the same line like this [CODE]5 5[/CODE] how do i do that? | |
In a program i have to calculate pow(2,N) where 0<N<=1000. which data type is suitable for this? I have used unsigned long long int but its range is also limited. | |
Hi all Please suggest an algorithm to find square root of a big number ( 100+ digits ) in C/C++.. Thank you | |
Here I am again... The question that I have is this: How do I sort an array of structures by two criteria? One element of the array looks like this: [CODE]struct record{ char name[32]; double value;};[/CODE] The goal would be to sort the array by name and if the name … | |
Hey friends, I want to compile a C program using Command prompt. I have the turbo C compiler. Please show me the way with a simple example. | |
hi. i want to print all the possible combinations of a string entered. for example:- string input is "abc"... then output is "abc bac acb bca cba cab" and it must be true for every length of string.. i have tried many times and applied as much logics i can. … |
The End.