15,552 Topics

Member Avatar for
Member Avatar for Syed Zeeshan Ahmed

I need help in writing a the following programs in C language: We want to determine whether a long string of a’s and b’s has the property that the number of a’s is even and the number of b’s is even. Algorithm 1: Keep two binary flags, the a-flag and …

Member Avatar for David W
0
250
Member Avatar for naz1234

hi, I am new to C programming. I want to program a running LED on my PIC24 (PIC24HJ256GP206) I have 5 LED on my PORT G and have input PORTB (RB0) My program should, if RB0 is grounded (I put jumper on my circuit) the LED will be running faster, …

0
184
Member Avatar for ovimanyrobin

Hi i am Robin from Bangladesh. I am a student of CSE(Computer Science Engineering). My dream is want to Job in Google thats why good and best programming is need to know for that. But i will never to try for best code typing like as lazy or sleepy. I …

Member Avatar for David W
0
132
Member Avatar for vikash_5
Member Avatar for Dee Wa Kar

WAP in C to check if the input number is positive or negative. The program should display positive if the number is 'positive', otherwise it should display 'negative'. Your program must also ask the user how many numbers he/she would like to enter as well before he starts entering value. …

Member Avatar for AndrisP
0
105
Member Avatar for can-mohan

Hi, in below code snippet i am trying to resume again forground process by issuing fg %1 in code but still it doesn't work. usually after issuing fg %1 from command prompt it should alwaysstart first suspended process but same is not happening and i am getting error like ; …

0
135
Member Avatar for Mir Mahfuz

#include <stdio.h> #include <string.h> int main() { char string[100]; int c = 0, count[26] = {0}; printf("Enter a string\n"); gets(string); while (string[c] != '\0') { if (string[c] >= 'a' && string[c] <= 'z') count[string[c]-'a']++; /*I do not understand this line/* c++; } for (c = 0; c < 26; c++) …

Member Avatar for David W
0
179
Member Avatar for Dhana_1

a robot is programmed to move forward 'F' meters and backwards again say 'B' meters in a straight line .the robt covers 1 meter in T units of time on robot path there is a ditch at a distance FD from intial oposition in forward direction as well as a …

Member Avatar for rproffitt
0
169
Member Avatar for fputs

How do you implement the open/close system calls on linux using C? What go's into the open file table? How do you create file's and delete file's?

Member Avatar for David W
0
197
Member Avatar for can-mohan

Hi All, I am writing hash function (similar to multimap concept of c++ : duplicate keys are allowed) in order to check the anagrams. but i am not getting desired result . Could you suggest efficient solution for the same. output: key[148]:val[joy] key[174]:val[jam] key[294]:val[paula] key[13]:val[ulrich] key[174]:val[cat] key[174]:val[act] key[148]:val[yoj] key[265]:val[vij] key[265]:val[jiv] …

0
162
Member Avatar for can-mohan

guys, I am implementing hash function in below code snippet but unfortunetly getting segmentation fault. Could you please help me to understand that what went wrong in this implementation. #include<stdio.h> #include<string.h> #include<stdlib.h> unsigned long hash(char** str ) { unsigned long hash_val = 5381; unsigned long sum=0; char* val ; int …

Member Avatar for can-mohan
0
391
Member Avatar for jakson321

Instruction: You must use pointers for this lab. No arrays, no structures. For example, if you need an array of floats to hold the scores, do not use float score[15]. Rather use float *score, then use dynamic memory allocation to hold required memory. You must use memory optimally, that is …

Member Avatar for David W
0
1K
Member Avatar for clife

Hi, I am using the below program to parse a file ,extarct values and store them into an array. Here i have same values repeated for example IP , so i need to take only instance of it but rest of data store accordingly. so the correct format is {IP …

Member Avatar for David W
0
246
Member Avatar for Nikkitha

someone please help me to solve this coding... Given 3 inputs - First input is previous reading, second input is current reading and last input is per unit charge , Write code to calculate the current bill. Reading Format - XXXXXAAAAA where XXXXX is consumer number and AAAAA is meter …

Member Avatar for David W
0
147
Member Avatar for Jane Colleen

Can somebody please tell me what im doing wrong, I know its the initVirtualHeap but i dont know why. The program just crashes. #include<stdio.h> #include<conio.h> #include<stdlib.h> #define MAX 10 typedef struct{ char elem; int next; }vArray; typedef struct{ vArray *nodes; int avail; }virtualHeap; typedef int List; void initList(virtualHeap *); int …

Member Avatar for Moschops
0
245
Member Avatar for Habib_7

I'm learning win32 programming from [Here](http://www.functionx.com/win32/Lesson03.htm) and I have problem in part of tutorial about string table it gives me this error: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with …

Member Avatar for Habib_7
0
311
Member Avatar for samuelneves

Hi everyone, hope you're doing fine... I'm new here and I just find Daniel Web when I was trying to understand why this message keeps appearing: "cannot find lgd2" and "cannot find lgd" [Click Here](http://pt-br.tinypic.com/r/20qhs0i/8) I don't get why this keeps appearing cause I went to Project>Build Options...>(Selected the name …

Member Avatar for Moschops
0
216
Member Avatar for JohnMcPherson

I am having a problem with reading input data after checking a position marker in the data file. The code that does the reading follows: fip = fopen("fprmf.txt","r"); . . . strcpy(passw,"P7"); fscanf(fip, "%3s", ckod); /* card # 164 */ fprintf(ff16,"\n\n%12s%12s\n", "card# 164 :", "Password "); printf("passwd is %s\n", ckod); …

Member Avatar for Nutster
0
800
Member Avatar for Bhavna_1

hello everyone i am running a program of dda line of cgm course the program does'nt give any error but when i run that program it gives linking....source filename.exe can anyone please help me in the same

Member Avatar for rubberman
-1
48
Member Avatar for vicky sheikh

Can anyone please elaborate this loop?? while(str<end) { temp=*str; *str++=*end; *end--=temp; } and especially 2nd and 3rd clause of loop either increment or assignment will be done first...

Member Avatar for Moschops
0
128
Member Avatar for Aishwarya786

User input 1234 567 scanf("%2d %2d",&value1,&value2); scanf("%3d %2d",&value1,&value2); scanf("%4d %3d",&value1,&value2); scanf("%-5d",&value1,&value2); How does all these work actually?? Iam confused..

Member Avatar for Kamal_9
0
154
Member Avatar for negru

How to print path of a binary tree after adding every node (branches of a tree have values 0 and 1)? For example, I have this binary tree: NODE1 has two children, NODE2 and NODE3. Branch from NODE1 to NODE2 is 0, and from NODE1 to NODE3 is 1. From …

Member Avatar for rubberman
0
185
Member Avatar for clife

Hi, I am familiar with C and C++, but dont use sockets regularly.I am facing problem in clinet-server program. my purpose is : 1. First client sends some info to server. 2. Server should read info and inturn send some info to client 3. Client reads info and again sends …

0
176
Member Avatar for sureshshan1292

Write a C program to Remove even numbers and fill it with zeros. Note: You can use only one loop for your logic. Two variables apart from the array. Input array 1,2,3,4,5,6 Output 1,3,5,0,0,0

Member Avatar for ekambaram
2
3K
Member Avatar for shajin c l

C program to remove even numbers and fill it with zero Input array 1,2,3,4,5,6 Output 1,3,5,0,0,0 #include<stdio.h> void main() int i,j,k,n=6,a[]={1,2,3,4,5,6}; clrscr(); for(i=0;i<n;i++) { if(a[i]%2==0) { a[i]=-1; } else printf("%d",a[i]); } for(i=0;i<n;i++) { if(a[i]==-1) printf("0"); } getch(); }

Member Avatar for Moschops
0
4K
Member Avatar for bharat_3

How this calculation is done i'am confused i am getting an answer 14 ?? #include<iostream> #include<conio.h> using namespace std;main() { int a=5; int d; d=++a + ++a; cout<<d; getch(); }

Member Avatar for shajin c l
0
194
Member Avatar for smart2007

I was writing a X-server display code to show movement of balls from one pixel location to next location, which can be visible at the new window opened up after execution of this code. While running the below code, I can get 5 red color filled circles (considered as balls). …

Member Avatar for Moschops
0
149
Member Avatar for elexender

Hi all, I have a question about file path in lunix. Since i pretty new to linux (im running ubuntu) i dont know how to give a correct file path to fopen command. I want to write some data to a usb drive. Let me show you how i would …

Member Avatar for Erkan_1
0
2K
Member Avatar for Feras_1

Binary file for cars of a certain city Each car of the record containing the following information: Car number - Year - color - figures the identities of the owners of the agenda this car. (Through the matrix at most 5 because of possible car owned by more than one …

Member Avatar for mack1
0
146
Member Avatar for Yahia Farghaly

Does compound literals techinque reserve a memory ? if i say int x; x=(int){1}+(int){2}; or total_sum=sum_arr((int[]){1,2,3}); and what's the best situation to use this techinque ?

Member Avatar for Yahia Farghaly
0
83

The End.