15,552 Topics

Member Avatar for
Member Avatar for ali11

how can i replace the array notation with pointer notation #include<stdio.h> #include<stdlib.h> #include <math.h> /* 4 */ void run_sieve(char *, int); /* 5 */ void print_primes(char *, int); /* 6 */ int main() { /* 7 */ int i, top; /* 8 */ printf("compute primes up to: "); /* 9 …

Member Avatar for -[xxxxxxx]-
0
247
Member Avatar for jake.jackson.7169709

I'm still a little confused. Basically this is what I'm trying to do, and I'm having one hell of a time with it... My program has two values "Value" and "N". The goal of the program is to select every Nth number of Value starting with the last, and print …

Member Avatar for dx9_programmer
0
215
Member Avatar for Delnith

I am looking for a project or goal to reach in order to improve me programming skills. I'd say I am still a beginner as it comes to C programming and would like a project to work on but cannot seem to think one, any ideas?

Member Avatar for Schol-R-LEA
0
229
Member Avatar for mahnaz0098

Hello I want to turn on a LED using C, meaning that I want to write on printer port. but the code doesn't work. I use char ledStatus instead of BYTE ledStatus. is there any difference?? what is the problem in this code? #include <windows.h> #include <conio.h> #include <staio.h> #define …

Member Avatar for Ancient Dragon
0
380
Member Avatar for omarelbeik

for the program im writing this is what i have to do: i have to write a C program that maintains a table of productID and price in a .txt file. The following menu shows the functionality of the program: 1. Display all products 2. Search product by ID 3. …

Member Avatar for Adak
0
316
Member Avatar for abd2

hi, this is the code: #include <stdio.h> main() { int m1, m2, m3, m4, m5, per; printf("Enter marks in five subjects\n"); scanf("%d%d%d%d%d",&m1,&m2,&m3,&m4,&m5); per=(m1+m2+m3+m4+m5)/5; if(per>=60) printf("first division\n"); if((per>=50) && (per<60)) printf("second division\n"); if((per>=40) && (per<50)) printf("third division\n"); if(per<40) printf("fail\n"); } this is the output for: [root@localhost lbin]# gcc -o division division.c …

Member Avatar for kimchong
2
2K
Member Avatar for kieranrea

**I've been over this code several times but still cannont figure out why after the first time, it always prints "Add in sale? Y/N:" twice. Any ideas?** void PrintHeader(); int TotalSales(); float OverallProfit(float totalvalue, float drinkcost, int runningcost); float CalculateCosts();//Not used yet int IncentiveCheck(); //Not used yet #include <stdio.h> #include …

Member Avatar for somjit{}
0
155
Member Avatar for Ankit.duke

Do any one have idea of implementing the moore machine by c Programming implementation??

Member Avatar for Despairy
0
78
Member Avatar for romiaujla

This is a part of the question of my assignment and i am facing problems on how to access the array in a function. Write a function that finds the 2nd minimum value among the given data items of float type, and returns the 2nd minimum. You should use pointer …

Member Avatar for romiaujla
0
215
Member Avatar for luixoja

Hi! Im very new in c programming and i have a lot of problems with this easy exercise. I have a struct for a matrix typedef struct { int dim; float **m; } t_matriu; I have a function to create a matrix and to generate random numbers to fill it. …

Member Avatar for deceptikon
0
128
Member Avatar for jnewman3

I'm applying the peterson solution for protecting memory of the critcal section. Each child process should contain a local variable that keeps track of the number of times it interrupts the other child while it is in its critical section. The process should display this value before terminating. I'm having …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for lp94

Input a 15 character word .. condition should be terminated if enter key, space or when size limit is reached calculate average of alphabet assuming A=1,B=2,C=3.......Z=26 a=27,b=28,c=29,........z=52 print only alphabets using array of characters and using formula to check whether character is alphabet, space lowercase and uppercase you can use …

Member Avatar for Adak
0
146
Member Avatar for razorsky

After much searching I cannot find a particular way to get a datafile into my structure. I understand how to create and manipulate the structure. C does not play nicely with strings is another thing I have noticed. I have tried many examples of how to do this but none …

Member Avatar for j.c.
0
9K
Member Avatar for Learningvinit

A piece of C code was creating core dump. When i simply added a few fprintf statement and printed the value of variales used in code to a file, surprisingly the code ran successfully. I tried the scenario number of times and the result was same "when fprintf was present …

Member Avatar for Learningvinit
0
865
Member Avatar for HunainHafeez

this code is working for a counter of 6 bit and i need a counter of 48 bit ... if u have time kindly try it..... i try alot but not succeed #include<stdio.h> #include<stdlib.h> #include<float.h> #include<math.h> #include <time.h> #include <cstdlib> #include <iostream> #include<stdint.h> #include<conio.h> int main() { int a[64][6]; int …

Member Avatar for HunainHafeez
0
264
Member Avatar for nitin1

Can any one please help me to optimize the sieve to find the primes upto 10^8 ? I want very efficient algorithm to find all primes till 10^8 for cryptsystem. i have implemented the naive sieve which is taking too much time. please sgare some classic approach with me. i …

Member Avatar for Adak
0
77
Member Avatar for Delnith

Using the code below I need to implement it such that p_poly has only one term of any degree and contains no terms with zero coefficients. I have tried to implement a temporary variable to no avail and was wondering if anyone else had an idea or possibly lead me …

Member Avatar for Delnith
0
88
Member Avatar for chandan127
Member Avatar for zeroliken
0
762
Member Avatar for pooja.singh.3950

want 2 print the following in c using loop |......| |..c...| |..ch..| |..chm..|

Member Avatar for deceptikon
0
224
Member Avatar for pravtdelhi

Hello, everyone. I am a first year IT Engineering student as well as a complete newbie to C (and programming in general). In my introductory course, I was given an assignment, which involves creating a program to get the elements of two 3x3 matrices from the user and display them …

Member Avatar for pravtdelhi
0
155
Member Avatar for chandrabhanu

This program in C finds 2 Longest common subsequence of 2 given strings(say X and Y),entered without any space on the screen individually,altering X and Y strings.I compiled and executed this above program successfully in Dev Cpp compiler as a C file(not a c++ file).

Member Avatar for hahahahohoho
-1
268
Member Avatar for sarah.mathieson.7

Hey! I'm brand new to programming in C and I am trying to practice coding by hand for my test tomorrow. I understand the basic concepts and I do have some experience in Java (not much) but I am horrible at coding by hand... anyway I am doing my best …

Member Avatar for Gonbe
0
241
Member Avatar for nitin1

i have to do division without divison/multiplication/mod operator. how can i ? int divide(int dividend, int divisor) { int p=1; if(dividend<0) { p*=-1; dividend*=-1; } if(divisor<0) {p*=-1; divisor*=-1; } while(dividend>=divisor) { dividend-=divisor; } return dividend*p; } i have done this, but this giving time limit exceeded when input is 1234567890,1. …

Member Avatar for somjit{}
0
222
Member Avatar for nitin1

#include<stdio.h> #include<limits.h> #define num 86090000 int a[5000000]={0}; short int s[99999999]; void sieve() { int i,j,p=sqrt(num); int k=0; a[k++]=2; for(i=3;i<=num;i=i*i) { s[i]=1; } s[3]=0; for(i=5;i<=num;i=i*i) { s[i]=1; } s[5]=0; for(i=7;i<=num;i=i*i) { s[i]=1; } s[7]=0; for(i=11;i<=num;i=i*i) { s[i]=1; } s[11]=0; for(i=13;i<=num;i=i*i) { s[i]=1; } s[13]=0; for(i=17;i<=num;i=i*i) { s[i]=1; } s[17]=0; for(i=19;i<=p;i+=2) { …

Member Avatar for Tumlee
0
92
Member Avatar for weblover

Hi, i have the following text file and i need to put inside a 2D array without knowing number of rows and columns in the text file. (i want C to count this also) i've tried something like that: for (int r = 0; r<2; r++) { for (int c …

Member Avatar for weblover
0
7K
Member Avatar for Rizwana Begum.A
Member Avatar for ZmohJ

My game is like "space invader". can someone tell me how can i move the ship at the same time i can also shoot bullets.. . TIA

Member Avatar for deceptikon
0
127
Member Avatar for rithish

hii i finished these topics 1.linked list 2.stack and queues.how much time will it take me to finish trees 1.binary tee 2.avl tree 3.b-tree 4.binary search 5.threaded binary tree??? actualy ill try through linked list will it be easy???

Member Avatar for Gonbe
0
110
Member Avatar for rithish

hello im trying to delete a middle node in binary tree .but i have tried it in a linked list but here how to do that does any one them has links or video tutorials???????????

Member Avatar for Gonbe
0
141
Member Avatar for xxwikkixx

Hey everyone need some help again with finding the min and max from a text file. its my college lab assignment. here is my code till now. #include <iostream> #include <fstream> using namespace std; int main() { ofstream fout; fout.open("Text.txt"); ifstream fin; fin.open("Lab6.txt"); float c; int count = 0; float …

Member Avatar for xxwikkixx
0
1K

The End.