15,550 Topics
![]() | |
write c programming of this question | |
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. … | |
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 ; … | |
#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++) … | |
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 … | |
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? | |
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] … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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); … | |
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 | |
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... | |
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.. | |
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 … | |
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 … | |
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 | |
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(); } | |
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(); } | |
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). … | |
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 … | |
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 … | |
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 ? | |
the employees must be registered in alphabetical order, but i don't know how........... struct EMP { int empno; char empName[MAX]; char designation[MAX]; struct EMP *next; }; struct EMP* insert(struct EMP *front, int id, char name[], char desg[]) { struct EMP *newnode; newnode = (struct EMP*) malloc(sizeof(struct EMP)); if (newnode == … | |
#include<stdio.h> int sum(int,int); int main() { int a=5; int b=6; int res; res=sum(a,b); printf("\n%d\n%d\n",a,b); printf("%d",res); } int sum(int x,int y) { x=x+1; y=y+3; return y; } This is a sample program where my a and b values didint change and the result of modified y (ie)9 is returned back to … | |
EDIT: Please note, as I write this, the post is now 6 years old and might have some outdated information. I'd personally recommend beginners start with "Learn C the hard way" by Zed and this book since I have heard good things about them. Reading the FAQ put together by … |
The End.