15,550 Topics

Member Avatar for
Member Avatar for msareef

this is the question: Write a C program that will request the user to input the values for R,L,and C and plot the a graph of current ,I, against frequency . The range for the frequency axis should be automatically selected based on the resonance frequency of the circuit.

Member Avatar for Mouche
0
2K
Member Avatar for D33wakar
0
347
Member Avatar for inspire_all

#include<stdio.h> #include<stdlib.h> //#define MAX 10001 void quicksort(long long[],int,int); int partition(long long[],int,int); void swap(long long[],int,int); int main() { int t,k,q,i,j,qi,c,p; long long *mot,*sat,*res; //printf("Enter no of test cases"); scanf("%d",&t); for(i=0;i<t;i++) { p=0; //printf("Enter no of chefs and no of queries"); scanf("\n%d %d",&k,&q); mot=(long long*)malloc(k*sizeof(long long)); sat=(long long*)malloc(k*sizeof(long long)); res=(long long*)malloc(k*k*sizeof(long long)); …

Member Avatar for deceptikon
0
201
Member Avatar for @di007
Member Avatar for Assembly Guy
0
108
Member Avatar for @di007

What is the difference between run time errors "Stack overflow.", "Access violation writing location 0x00000000." and "Stack around the variable 'w' was corrupted."

Member Avatar for deceptikon
0
145
Member Avatar for newbie14

I have a char all[1500]; which will store each network packet. I will convert the hex value into humand readable. Finally I need to extract the url. For e.g. I have this GET /mail/ HTTP/1.1\r\n. I know I can use first to decide if the word GET and HTTP/1.1. exist …

Member Avatar for newbie14
0
140
Member Avatar for greatman05

Hello. I need to set up some pipes for a homework assignment as part of a bigger project. The issue I'm having is that the array (args) I'm using to populate the pipe arguments keeps segfaulting and I don't know why. Everything has been malloced beforehand and the faults only …

Member Avatar for greatman05
0
258
Member Avatar for Carlos_9

I NEED HELP PLEAS #include <stdio.h> #include <stdlib.h> #include <string> #include <ctype.h> #include <iostream> using namespace std; struct Player { int yearsPlaying; float playerPay; string playerLastname; string playerAge; string playerName; char playerNumber[100]; }; const char fileName [] = "Players.txt"; void createFile(void); void printPlayer(struct Player*pi); void writePlayer(FILE *fp, struct Player *pi); …

Member Avatar for deceptikon
0
226
Member Avatar for Alonso_1

So I'm trying to count the number of occurrences of each digit within an array. My code I've got so far looks like the following: #include <stdio.h> #include <string.h> int main() { int numbers [10]= {1, 4, 5, 5, 5, 6, 6, 3, 2, 1}; int count = 0; for(int …

Member Avatar for deceptikon
0
3K
Member Avatar for D33wakar

This is a simple echo server that I've written while learning sockets programming. Compile the server and run it. You can connect to it using telnet like this: telnet localhost 1337 Disconnect the client by typing "/quit" without quotes.

0
380
Member Avatar for taekgo

Can someone help me with the codes in C language.this is the problem: create a program that will display the factors of a given number.the input must read from a text file and consist of one or more lines,each line contains a number. Sample input from a text file: 6 …

Member Avatar for v.r.t
-4
2K
Member Avatar for Warren_1

#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> // free- A lot of extra marks //Avoid global variables. struct packet { //struct for the packets int source; int destination; int type; int port; char data[49];//starts at 0 }; int add(); //to add a packet void view(); // view a created …

Member Avatar for deceptikon
0
380
Member Avatar for castajiz_2

int main(int argc, char** argv) { FILE *f; char string[100]; int counter=0; f=fopen("New Text Document.txt","r"); if (f==NULL) { printf("error"); } while(!feof(f)) { fscanf(f,"%c",&string); } fclose(f); for(int i=0;i<100;i++) { if (string[i]=='a') /*doesnt work, why?*/ { counter++; } } printf("\n the number of vowels a is : %d",counter); getch(); return 0; } …

Member Avatar for deceptikon
0
145
Member Avatar for saimadanmohan

In the brute force pattern matching algorithm when all the characters in the pattern are unique then brute force can be implemented in Big-oh(n) complexity where n is the length of the string (reference: introduction to algorithms). can anyone help me with the algorithm? Thanks in advance

Member Avatar for stevedaniel
0
267
Member Avatar for ahmadfaiz.ahmadaffandi

Enter X, Y coordinates for your move : 2,3 _0|_0|__ _X|_X|_X | | Congratulation Player 1 ! you have WON! Want to play again? y/n How can I reset the array in order to continue playing after finish playing the first round? #include<stdio.h> #include<stdlib.h> #include<string.h> char array[5][5]={' ','|',' ','|',' ','-',' …

Member Avatar for gusano79
0
239
Member Avatar for castajiz_2

As it is said in the title i can not get the keyword string. I finally found a version of C for windows 8 but now i can t get the most important thing types int, double char,bool ect... work perfectly and always show as a keyword but somehow i …

Member Avatar for Ancient Dragon
0
291
Member Avatar for COKEDUDE

I am trying to print an array of linked lists. I am having trouble getting it to print. Here is my struct. typedef struct VERTEXTAG { char c; bool isvisited; struct EDGETAG* p; }VERTEX; typedef struct EDGETAG { VERTEX* v; struct EDGETAG* q; //cookies rock //I like cookies }EDGE; Here …

Member Avatar for Ancient Dragon
0
275
Member Avatar for COKEDUDE

What is the difference between fscanf and fgetc? I have a few people arguing with me on the differences. I thought fgetc reads character by character of a file. I thought fscanf reads the whole file. Is that corrrect? Can someone elaborate on what I forgot?

Member Avatar for COKEDUDE
0
2K
Member Avatar for sing1006

#include <time.h> #include <math.h> #include <stdio.h> #include <conio.h> #include <string.h> #include <stdlib.h> #define ROW 9 #define COL 9 int printboard(int grid[ROW][COL]){ int x,y,n,chk; srand(time(NULL)); for(x=0;x<ROW;x++){ for(y=0;y<COL;y++){ do{ n=rand()%7+2; grid[x][y]=n; if (((grid[x][y]==grid[x-1][y]) && (grid[x][y]==grid[x-2][y])) || ((grid[x][y]==grid[x][y-1]) && (grid[x][y]==grid[x][y-2]))){ chk=1; continue; }else{ chk=0; printf("%d ", n); } }while(chk==1); } printf("\n\n"); } } …

Member Avatar for Ancient Dragon
0
424
Member Avatar for COKEDUDE

When doing a linked list of chars with just a single character do you think it's better to use pointers in your struct like this? Typedef struct String_Node { Struct String_Node* next; Struct String_Node* prev; int id; char* c; } String_Node_t; Or better to not use a pointer with the …

Member Avatar for deceptikon
0
937
Member Avatar for qasim.khan.923724

Can anyone help me with this code i have started it but then I got confused thanks. Option 1: Create two-dimensional array choc_yourname[50][7] using the data in file chocolates.txt and print the values of this array on the screen Option 2: Calculate the average quantity of sold chocolates per day …

Member Avatar for qasim.khan.923724
0
137
Member Avatar for deceptikon

This will be a relatively quick article because it's a simple issue. The `system` function gets a lot of flak for being slow because it calls the shell runtime to execute a command, but I rarely see the more devastating issue of security brought up. `system` is insecure in many …

Member Avatar for Assembly Guy
0
301
Member Avatar for code2cplus

a simple program to find out the permutations of all the letters in the word ex: abc gives abc acb bac bca cba cab[code]void swap(char *p,char *q){ char c; c=*p; *p=*q; *q=c; } void perm(char *a,int m,int n) { if(m==n){ for(int i=0;i<=n;i++) cout<<a[i]; } else { for(int j=n;j<=m;j++) { swap(a[j],a[n]); …

Member Avatar for Assembly Guy
0
683
Member Avatar for Ng

When i compare two strings i can use strcmp. But i want to know that when i compared more than 2 strings. Have any function OR method i can use? Thanks.

Member Avatar for deceptikon
0
76
Member Avatar for Ng

I am doing data validation. Assume i type 3 student ID: First:1234 Second:4567 Third:1234 (same ask the user to type student id again) Please give me some hints,how can i do the part of checking the all data the user type? (whether have already exit). Thanks. #include<stdio.h> int main() { …

Member Avatar for Learner010
0
125
Member Avatar for honoluluu99

Creat a program that: -Asks you your age -Takes your input and stores it in an integer variable -Takes text input and stores it in character array (string) -Has a loop that prints this pattern: * ** *** **** ***** ****** ******* ******** ********* **********

Member Avatar for Learner010
0
69
Member Avatar for Zube_1

i have written a code in matlab.... it goes like I=imread('path'); c=~im2bw(i); [x,y]=find(c==1); a=median(x); b=median(y); d=plot(b,a,'r.'); imshow(d); basic task is to take an image of a block with a small circle mark.... find the location of circle ([x,y] in code above)....find centre of circle (a, b in this code)....and place …

Member Avatar for koulakhilesh
0
97
Member Avatar for jzamora28

hi I am a high school student in a programing class and I need help writing my C program. If someone is willing to help me please let me know if I can contact you by email. Thank you. Jess

Member Avatar for Stuugie
0
63
Member Avatar for COKEDUDE

I am trying to calculate the size of char *. I would would think one of these 2 methods would work but they are not. char *vertices; printf(strlen(vertices)); printf(sizeof(vertices));

Member Avatar for Ancient Dragon
0
261
Member Avatar for sing1006

int menu(c){ int choose; do{ printf("*MENU\n"); printf("*Press 2 to move down\n"); printf("*Press 4 to move left\n"); printf("*Press 6 to move right\n"); printf("*Press 8 to move up\n"); printf("*Press 5 to switch\n"); printf("*Press 0 to quit\n"); printf("Please enter your choose: "); scanf("%i",&choose); if(choose==2){ }else if(choose==4){ }else if(choose==6){ }else if(choose==8){ }else if(choose==5){ }else …

Member Avatar for deceptikon
0
210

The End.