15,551 Topics

Member Avatar for
Member Avatar for Bhavesh Nariya

// Program to show swap of two no’s without using third variable #include<stdio.h> #include<conio.h> void main() { int a, b; printf("\nEnter value for num1 & num2 : "); scanf("%d %d", &a, &b); a=a+b-(a=b); //Swaping printf("\nAfter swapping value of a : %d", a); printf("\nAfter swapping value of b : %d", b); …

Member Avatar for Oddytech
-3
2K
Member Avatar for naz1234

Hi, I got some data from this table. Can it be use using (for loop) ? http://i.imgur.com/lq7WtWA.png Recently, I used (if else) function, but it seem too longer. I am new to C progrmming. Here the code (if else) funtion that I done: if (0 < result < 409 ) …

Member Avatar for jnneson
0
263
Member Avatar for Anirudh_2

Hi! I have a hexadecimal word in the form of a string, and i need to convert it into binary. For eg : AA FF (there is a space in between the two parts). How do i convert this into binary ? Thanks in advance :)

Member Avatar for Moschops
0
222
Member Avatar for COKEDUDE

If you carefully look at this example you will see with atoi when it runs into a string it gives the integer value of 0. So I was wondering how you tell the difference between the integer value of 0 and a string that got converted to 0. http://www.tutorialspoint.com/c_standard_library/c_function_atoi.htm

Member Avatar for deceptikon
0
132
Member Avatar for COKEDUDE

Is the ordering of checking if a number is between two values important? I figured this would be pretty simple to do but its not working. if(0 <= (int)strings[p][0] && (int)strings[p][0] <= 9) { printf ("NUM: %s\n",strings[p]);; } else { printf ("ID: %s\n",strings[p]); }

Member Avatar for JamesCherrill
0
1K
Member Avatar for hazelkahn

Write a function sin Left(a, b, k) that estimates the area under the sin function in the interval from a to b on the x-axis (where a≤b) by dividing the interval intoksub-intervals and adding up the areas of the rectangles in each sub-interval. The height of a rectangle in a …

Member Avatar for JamesCherrill
-2
156
Member Avatar for cjj282

can anyone guide me to good websites with respect to this topic "image deblur without original image" I have gone through a number of papers and codes for a week. all examples had codes which took a original good image added a blur function & then deblurred that image. I …

0
114
Member Avatar for COKEDUDE

I'm having trouble with the if statement. I have verified with print statements that (int)strings_line_tokens[l][m] == 0. I thought maybe my logic was backwards since I had two not statements with an or, so I changed it to an and. That didn't help either. if((int)strings_line_tokens[l][m] != 10 || (int)strings_line_tokens[l][m] != …

Member Avatar for Moschops
0
143
Member Avatar for JohnMcPherson

Hello, this is a very strange problem. I had first put this discussion in the Linux and Unix thread, since I believe it is actually a problem with how the data is entered via but the vi editor, but I closed those out and will put it in the C …

Member Avatar for Nutster
0
288
Member Avatar for bhavinvyas28

How to Store Multiple file data in nested structures. i have for e.g File1.txt ========= ADD:1,2 MULTIPLY:3,4 PRINT:HELLO WORLD File2.txt ========= SUBTRACT:4,5 DIVIDE:5,7 PRINT:HELLO NAME I need a C Program to store The file data in structures. And According to command given should do what is required. The size of …

0
83
Member Avatar for naz1234

How to count number in C language ? For example , I have have input 5 until 7 then it will print 3 or input 2 until 4 then it will print 3 here my code: #include <stdio.h> int main() { int n,count=0; printf("Enter an integer: "); scanf("%d", &n); while(n!=0) …

Member Avatar for nullptr
0
207
Member Avatar for naz1234

Hi, how to make counting numbers ? For example, I send command to HyperTerminal, then it will reply (print) counted values. Here the first example, send command: UI1-UI10 reply command: UI1-UI10_in_Hexadecimal:0x3FF The above example, Ui1 until Ui10, it count, one until ten. Then, the binary will have IIIIIIIIII (10bit), but …

Member Avatar for chriswelborn
0
239
Member Avatar for COKEDUDE

Is there a way to split a string at different types of characters into separate strings? char str[] ="(I) 44like22 .cookies. ,This, /is\ ?tricky?"; Something like this? ( I ) 44 like 22 . cookies . , This , / is \ ? tricky ?

Member Avatar for David W
0
243
Member Avatar for COKEDUDE

I have seen both ways for reading file error messages. Is one better than the other? Is exit(0) better than return 1 or vice versa? FILE *fp; fp = fopen(argv[1], "r"); //Open file for read. if(!fp) { printf("Error opening file %s!",argv[1]); //Program prints error message and closes if file is …

Member Avatar for Moschops
0
227
Member Avatar for COKEDUDE

I need to read a file that is completely random and do something based on whatever character I get. I can get any of these character types "/", "*", a string, or numbers. I need to do something different with each case. I think the best way would be to …

0
86
Member Avatar for boomtifier

i need samples on calculating average the average of "C Program=50" "Html5=70" "DreamWaver=70" "SQL Server=80"

Member Avatar for ddanbe
0
205
Member Avatar for k_manimuthu

Hi All, I am trying to write perl code for extract 'C' user defined function from 'diff' format file. I am using the below keyword to identify the function 'starting pharse' (return value). I am not familar about 'C'. Please suggest some addtion return type which missing from the below …

Member Avatar for rubberman
0
311
Member Avatar for christian_5

use a do while loop to calculate the minimum of 100 integers. How to?? plesae help meee

Member Avatar for rubberman
0
70
Member Avatar for mimic03

I created a 2D array and filled it with random values from 0 to 100 and now i'm trying to find the average and maximum number of all the value inside it. But i'm having serious problems understanding the problem with my functions and how to connect them in the …

Member Avatar for Moschops
0
312
Member Avatar for sssajibsaha

Write a C program which finds out prime numbers between the range 1 to MAX by creating n child processes and subdividing the task equally among all child processes. Value of MAX and n are passed as command line arguments. The parent process must wait until all child process finishes.

Member Avatar for ddanbe
0
69
Member Avatar for chubbyy.putto

Hello There, Can I someone explain this problem. I dont understand what mean. I have read over and over i still dont get it. Assume you need an application that operates on two kinds of data types D1 and D2. Both D1 and D2 need to be defined with typedef. …

Member Avatar for chubbyy.putto
0
160
Member Avatar for boomtifier

I need a Sample of of calulating the Average of "C Program=50,HTML=50 and others THREE examples" (NOTE;USING CODE BLOCKS COMPLIER WILL BE DEEPLY APPRECIATED)

Member Avatar for boomtifier
-1
91
Member Avatar for Sandeep_14

Compute the definite integral of the curve x 2 − 3 x + 2 ​ for x ranging from 2 to 8. Compute the same by approximating it by dividing the region into many small trapeziums. Keep increasing the number of trapeziums to get to the accuracy of 3 decimal …

Member Avatar for David W
-2
131
Member Avatar for Sandeep_14

Compute number of days between two dates of the same year. A date is given as two numbers (day, month). Assume that month of Feb has 28 days

Member Avatar for David W
-1
949
Member Avatar for jamesjohnson25

#include <stdio.h> #include <stdlib.h> char* format(char* buffer,size_t size, const char* name,int quantity,int weight){ snprintf(buffer,size,"Item: %s Quantity: %d Weight: %d",name,quantity,weight); return buffer; } int main() { char *buffer = (char*)malloc(90); printf("%s\n",format(buffer,sizeof(buffer),"Axle",25,45)); return 0; } When i run the above program, i expect the output Item: Axle Quantity: 25 Weight: 45 But …

Member Avatar for Moschops
0
137
Member Avatar for can-mohan

Hi All, in below code snippet, I have been facing memory leak issue while free memory for string.Could you let me know thereason for the same.I believe if we are allocating memory then it needs to be freedbut what i observed if i don't free the memory it works fine …

Member Avatar for can-mohan
0
1K
Member Avatar for naz1234

Hi, from the result in my "for" loop, have stored four value. How to extract that value to show the value(sprintf) ? Kindly refer to the attached the image file. Thanks Regrads, nazif

Member Avatar for naz1234
0
227
Member Avatar for Mayukh_1

Can you please explain the reason of the garbage output instead of the each words in the string.. #include <stdio.h> #include <string.h> #include <stdlib.h> int count = 0; //char** memptr = NULL; char** push(char* word, char** memptr){ if(count > 1) memptr = (char**)realloc(memptr, (count * sizeof(char*)) ); memptr[count - 1] …

Member Avatar for JohnMcPherson
0
113
Member Avatar for naz1234

Hi, I got error in send_string(lala): how to fix it ? thnaks ... #include <p24Hxxxx.h> #include <libpic30.h> #include <stdio.h> int FBS __attribute__((space(prog), address(0xF80000))) = 0xCF ; //_FBS( // BWRP_WRPROTECT_OFF & // Boot Segment Write Protect (Boot Segment may be written) // BSS_NO_FLASH & // Boot Segment Program Flash Code Protection …

Member Avatar for rubberman
0
193
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
247

The End.