- Strength to Increase Rep
- +4
- Strength to Decrease Rep
- -1
- Upvotes Received
- 5
- Posts with Upvotes
- 4
- Upvoting Members
- 5
- Downvotes Received
- 8
- Posts with Downvotes
- 4
- Downvoting Members
- 7
Re:
Hi, I would like to print the table of a number entered by the user like 2 *1=2 2*2=4 2*3=6 The code is [code=c]#include<stdio.h> #include<conio.h> main() { int i,num; printf("Enter any number"); scanf("%d",&num); for(i=1;i<=num;i++) printf("%d*%d=%d",num,i,num*i); getch(); }[/code] But this code is generating errors. |
|
Re:
Returns the largest sum of contiguous integers in the array Example: if the input is (-1, 2, -3, 2, 0, 5, -11), the largest sum is 7 Time complexity is O(n). |
|
Re:
HI the prgram below request a user to enter 3 character id number and interger age. a function must be used that tells the user how many years to retirement. i must pass the age and print a message in the function. retirement age is 65 for persons over 45 … |
|
[CODE] #include<stdio.h> #include<stdlib.h> #define MAX 5 char queue[MAX][30]; int front, rear, temp; void init() { front = -1; rear = -1; } void insert() { if ( rear >= MAX-1 && front == -1 ) { printf("\nQueue overflow"); return ; } temp = rear; rear = ( rear + 1 … |
|
Re:
Can anyone give me some ideas on how to find the middle value between 3 numbers.? I really dont know how to start... I know how find minimum and maximum but finding the Middle value is kinda hard for me... For those C Wizards give me some idea advice please?., … |
|
Re:
Hello, Can someone explain me what does this mean? "40[^\"], %*c" Thanks |
|
Hi , i know one method of deleting a record from a binary file. that is : read the contents of the file and every time check for some criteria based on which we want to delete the record. if record does not match criteria then write to new file … |
|
hi, how the below code is generating out put as " -1 < ( unsigned char ) 1 ". i read in many books saying when we do operation with singed and unsigned value always the resultant will be data type that has more width . i understand that -1 … |
|
Re:
Hi.I write a program in C for my microcontroller(PIC 18F452) but faced to a problem that related only to C language and that is; as you can see in my Main program and the two Functions I want to pass an array of ; " int adcvalmax[8] " which got … |
|
Hi, i have written a program to find the power of two numbers using iteration. The problem here is that to return the correct out put for even powers but not for odd powers. b = base , e = expo ,p= power( b, e);; for even powers the statements … |
|
Hi, [CODE] #include<stdio.h> int main( void ) { float a = 0.2; if( a > 0.2 ) printf( "\n a is greater than 0.2" ); else if( a < 0.2 ) printf( "\n a is less than 0.2" ); else printf( "\n a is equal to 0.2" ); return 0; … |
|
what is the correct declaration of pointer to a pointer to array of N elements. ( i want to store address of pointer to an array of n elements ) i am using the below declarions seperately , but getting errors. [CODE] int (*p)[4]; int (*p1) (*)[4] = &p; int … |
|
1. Why Nesting of comments is not supported by c. code does not involve much complexity to have that. 2. Why Array partial initialization have zero appended. why it cannot do in normal declaration. 3. continued.... Thanks, 3R |
|
Hi, I have written a program just to check the behaviour of the compiler. i expected an error in function call statement. but its not generating any error. the declaration of function we include to check the type of args and no of args and return value of function. but … |
|
Re:
Hi, i am working on Numerical Computation with C.... i have a data file which has two columns separated by a tab in between... it looks like [code] 43.0000000000000 43.0000000000000 42.0000000000023 43.0000000000006 41.0000000000000 43.0000000000056 40.0000000000000 43.1999996948242 [/code] i have written this code which seems to work out smoothly... [code] #include … |
|
Hi, Please some one clarify what does the below snippets mean and the compiler assumptions. which one is the correct one to use, what is the problem with others. [CODE] main() { } [/CODE] [CODE] void main() { } [/CODE] [CODE] int main() { } [/CODE] [CODE] int main() { … |
|
Hi , i have read that new line character gets converted to \r\n when writing characters to a file and converted to new line again when reading. but i observed one thing here. i have written contents hello followed by return key . and i have written a program to … |
|
Hi , when i run the program i got the same out put by using memcpy and memmove but i dont understand the difference between them. manual page says that memory area should not overlap in memcpy but can in memmove. what is meant by moving memory and how its … |
|
here i have two bubble sort versions. [CODE] void bsort() { int i,j,jc=0,ic=0,temp,swap=1; //for(i=0;i<NOE & swap;i++){ this one or for(i=0;i<NOE-1 & swap;i++){ \\ this swap=0,ic++; for(j=0;j<NOE-1-i;j++){ jc++; if(a[j]>a[j+1]){ temp = a[j]; a[j] = a[j+1]; a[j+1] = temp; swap = 1; } } } printf("jc=%d ic=%d\n",jc,ic); } [/CODE] i checked it … |
|
Re:
deleting string... example: deleting... enter string: the quick brown fox and the lazy dog. enter string to delete: the([I]the first one[/I]) new string: quick brown fox and the lazy dog. |
|
Hi, i understand the ieee 754 representation. but can some one explain why we need to add specifically 127 to the power of 2. for ex: 5.75 ; 101.110 can be written as 1.01110 * 2 ^ 2 127 +2 = 129 . i.e 10000001 now IEEE 754 of 5.75 … |
|
below is one simplest code to illustare the pyramid of number. [CODE] void piramid(int const c) { int r, x; for (r = c; r > 0; r--) { for (x = 1; x < = (2 * c - r); x++) { if (x < r) printf(" "); else … |
|
[CODE] #define fst 1 int main() { #if( fst ==1 ) printf("FST\n"); #else printf("Dummy FST\n"); return 0; }[/CODE] if i replace the statement in line 4 with [ICODE] #if fst [/ICODE] also the code is working. can any one tell me what is the correct way , advantages and disadvantages. |
|
As far as my understanding and other referals i understood that when the address of a local variable is returned the first call using this address may print the correct value but if it is called after any other function may get undefined values. but my program is returning the … |
|
Hi , so far i have been concentrating on programming aspects. now its time to learn some internals of C -compiler. Lexical Analyzer Parser Hashtables Syntax Checkers Expression Evaluators Symbol table : etc please share me some info related to symbol table what are the contents of the symbol table … |
|
i am writting a program for finding the no of keyword ( occurances ) and operators occurances. i am taking the all the keywords in an array and all the operators in seperate arrays for each category of operators. char *kw[] = {"auto","break"..."while" }; char *Arth_op[] = { "%","*","+","-","/"}; according … |
|
Hi, i have a doubt regarding conditional macros and undef directive. can i use undef for a function like - macro, by just specifying the name of the macro with out specifying the argument list as written in line 8. is the code correct with out these statements: [ICODE] #define … |
|
Hi , I want to write a program on Lexical Analyzer: which finds the no of keywords, no of operators ( based on the classification arithmetic, logical,....), constants, and others. please suggest me one good method. i am using a method which follows as below: char *Arith_Oper[]={ "+", "-", "*", … |
|
how the sizeof array is the total number of elements multiped by its base data type size, when the name of the array gives only the base address. [ICODE] int array [5]; sizeof array ; [/ICODE] gives 20 bytes. why not 4 bytes. because [ICODE] array = &array[0] .[/ICODE] |
|
Hi, i understand merge sort & quick sort even i can write the programs but iam unable to understand its complexity. its very easy to derive complexity equations for selection & bubble sort. as the code is little complex & recursive nature i am unable to understand its complexity and … |