15,551 Topics

Member Avatar for
Member Avatar for artur.sinelnikovs

Here is a sample exam. What other kinds of questions do you think I could prepare before walking in there since all resources are permitted? Write a single program which contains functions to do the following steps. Each of these steps involve reading the file above and displaying some of …

Member Avatar for deceptikon
0
259
Member Avatar for general2012

I am trying to allocate memory for three string and print it to screen.but it isnt working .can anyone explain what's wrong here #include<stdio.h> #include<stdlib.h> #include<string.h> int main() { char **name; int i; name=(char **)malloc(3 * sizeof(char *)); while(i<3){ name[i]=(char *)malloc(20 * sizeof(char)); } while(i<3){ scanf("%s",name[i]); } while(i<3){ printf("%s",name[i]); } …

Member Avatar for Ancient Dragon
0
187
Member Avatar for lalitha2294

Show 10 students data ( student id, father's name, phone number, mail id) in a file and write a C program to display the student's data whose id is given by a user through the keyboard. Please help me out in solving this program. I know how to read data …

Member Avatar for lalitha2294
0
154
Member Avatar for Vish0203

I wrote a program, in which my code is checking the word entered by user and the word in a file. If the words are not same, the file is deleted. i closed the file using **fclose(fp)**, (where fp is file pointer) and to delete the file i used **system("del …

Member Avatar for Vish0203
0
84
Member Avatar for Moein313

what is top down in writing an algorithm ? and what are differences of it and stepwise ?

Member Avatar for deceptikon
0
41
Member Avatar for kborana
Member Avatar for general2012

# copy string into a structure # all i am trying to do here is to copy a string input given by user into an arry decleared inside a structure.but my code is not working. anyone please explain to me why this code isnt working #include<stdio.h> #include<string.h> typedef struct{ int …

Member Avatar for general2012
0
186
Member Avatar for rotenegg

error in ma program it shows the last digit twice. #include<conio.h> #include<stdio.h> int main() { int fib(int); int n,c,a=0,b=1; printf("enter a number: "); scanf("%d",&n); printf("%d %d ",a,b); c=fib(n); printf("%d ",c); getch(); } int fib(int n) { int a=0,i,b=1,sum; for(i=0;i<n-2;i++) { sum=a+b; a=b; b=sum; printf("%d ",sum); } return(sum); }

Member Avatar for NP-complete
0
200
Member Avatar for akku123

hey i have a project on logic circuit simulation.i don't know how to include basic gate images in my code,so that it is displayed with the chosen gates output.i have jgrasp c_compiler.so plz help me out. #include<stdio.h> int And(int a, int b); int Or(int a, int b); int Not(int a); …

Member Avatar for rubberman
0
142
Member Avatar for general2012

# copy string into a structure # **all i am trying to do here is to copy a string input given by user into an arry decleared inside a structure.but my code is not working. anyone please explain to me why this code isnt working** #include<stdio.h> #include<string.h> typedef struct{ int …

Member Avatar for general2012
0
5K
Member Avatar for gunvinayaka

sir i need c code to generate random numbers between 1 to 100 and where the user can select the range(say 50 random numbers between 1 to 100 or 20 random numbers from 1 to 100 ) such that generated random sequence are not psuedo random numbers when it is …

Member Avatar for deceptikon
0
397
Member Avatar for general2012

# 2-D string implementation # ## i am new to c.anyone please help me why this code is not working## #include<stdio.h> #include<stdlib.h> #include<conio.h> typedef struct{ char name[2][10]; }college ; int main() { college student; student.name={{"james"}, {"carter"}}; printf("%s %s ", student.name); getch(); } **

Member Avatar for general2012
0
139
Member Avatar for anestistsoukalis

**This is a sample text file. Your program should add a space after the following comma,and after this comma,but not after this comma, because there is already a space. Similarly, it should add a space after the following fullstop.And after this fullstop.But not after this fullstop. Goodluck.** # I want …

Member Avatar for Adak
0
103
Member Avatar for awaisahmad13

This is the code do look at it. I just want change it in switch statement. will stuck in it. it is unix code. commands[0] = (char *)"ls"; params[0] = (char*)0; commands[1] = (char *)"who"; params[1] = (char*)0; commands[2] = (char *)"date"; params[2] = (char*)"+%d/%m/%y"; commands[3] = (char *)"ps"; params[3] …

Member Avatar for rotenegg
0
215
Member Avatar for dmo1

Hello. I am writing a program that computes net pay by the user entering in hours and payrate. There can only be one decimal, two numbers after the decimal, and no letters. When payrate is entered wrong, it displays the correct error message. For hours, it doesn't even though it …

Member Avatar for dmo1
0
146
Member Avatar for Grandiago

Hi im using turbo C++ compiler and im currently learning C. Iand have an assignment that i need to make a program that solves mathematical problems. Well first is that. the user would have to input a problem in whichever way the user wants. like this example: (5*2)+2-2/2 it could …

Member Avatar for Grandiago
0
319
Member Avatar for artur.sinelnikovs

The "r" function works well! #include <stdio.h> #include <string.h> #include <stdlib.h> int main(void){ FILE *file_r, *file_w; int c; char fileread[40]; char filewrite[40]; printf("Enter filename to be copied: "); gets(fileread, 40, stdin); fileread[strlen(fileread)-1] = '\0'; file_r = fopen(fileread, "r"); while(file_r == NULL) { printf("Invalid file, ealnter again!"); fgets(fileread, 40, stdin); fileread[strlen(fileread)-1] …

Member Avatar for deceptikon
0
189
Member Avatar for Cw Will

Anyone can help? What is the codes to let the word in twinkling motion? I am in trouble of it ><

Member Avatar for Adak
0
274
Member Avatar for Vish0203

I'm new to win32 application building using C. I'm using DEV C++ and I'm able to get a window, by using the "windows application" icon in DEV. I want to know how to display our text on to the window??? That'll be very helpfull! This is the readymade code generated …

Member Avatar for Ancient Dragon
0
4K
Member Avatar for pestallozi

a) Write an algorithm to add and multiply two large integers, which cannot be represented by built-in types. b) Write a “c” function to find recursively the maximum and minimum element of an array A of size “n” elements. Find also the number of comparisons required for this. a) Write …

Member Avatar for pestallozi
0
118
Member Avatar for Ranjan_1

why in a calculator program using command line argument multiplication not done???? in Gcc

Member Avatar for Peter.Aye
0
52
Member Avatar for davecoventry

I am trying to access a string. wchar_t *str; char *Pname; FILE *fp; str = somefunction(); Pname = str; fp = fopen ("/tmp/test","a+"); fprintf(fp,"%s\n",Pname); fclose(fp); str actually contains "ABigName", but the file simply contains the first letter, "A".

Member Avatar for deceptikon
0
174
Member Avatar for boiishuvo

Okay I am trying to write a program where a parent process creates three child processes. Also waits for each of them to finish. Here is my code: [code] #include <stdio.h> #include <unistd.h> main() { int i; // create 3 child processes for (i = 0; i < 3; i++) …

Member Avatar for rakeshbiswal
0
4K
Member Avatar for Dark_Knight

Hi, I've been having some problems with the getchar() statement. When I put it in a loop (to make an interactive input), I can't get user input anymore from within the loop. Even the following simple program doesn't work: [code] #include <stdio.h> #include <stdlib.h> int main(void) { char response, text[255]; …

Member Avatar for jigar23
0
2K
Member Avatar for artur.sinelnikovs

This is a simple calcualtor program. What I don't understand is how I could modify it so that the calculation parameters could be intered from cmd. I don't understand how the argv and argc really work in this case. Do I need to replace all the ints with argv or …

Member Avatar for deceptikon
0
159
Member Avatar for danielkull

Hi, I have a function which returns a pointer to array with data: `float * EZ_MATH::EZ_GE_BY_ME() { ... }` Now, how can I access this data? This doesnt work: `float * memA = temp_m.EZ_MATH::EZ_GE_BY_ME();` `ofstream output("out_file", ios::out);` `output << memA[0] <<endl;` `output << memA[1] <<endl;` Help!

Member Avatar for ravenous
0
285
Member Avatar for harishjoy

Hi , I have this code for win xp `char NotesDir[] = "\\Program Files\\notesw32"; char Fname[] = "C:\\Program Files\\notesw32\\notes.ini"; char Bakname[] = "C:\\Program Files\\notesw32\\notesini.bak";` But for win 7 , these files will be present in c:\\Program Files (x86) folder. How do i make sure my code works for both xp …

Member Avatar for harishjoy
0
286
Member Avatar for nitin1

#include<stdio.h> #include<conio.h> int main() { long double p=778.567; printf("%Lf",p); getch(); return 0; } it's output is : -115403.... something... why is it so ?

Member Avatar for nitin1
0
142
Member Avatar for ulrik m.

The following short program is taken from a book in numerical analysis (by Mircea Andrecut). It's about bisection (very simple): #include<stdio.h> #include<stdlib.h> #include<math.h> double f(double x) { return x*x-3; } double bisection(double f(double), double a, double b) { double epsilon = 1E-7, x; int kmax, k; if (f(a)*f(b) > 0) …

Member Avatar for nitin1
0
301
Member Avatar for syria718

guyss i just want to ask if anyone could show me a sample program on how to count the number of words,letters,and sentences in a file....using the c language.... thanks in advance!!

Member Avatar for bhavya_best
0
3K

The End.