Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
76% Quality Score
Upvotes Received
20
Posts with Upvotes
18
Upvoting Members
9
Downvotes Received
6
Posts with Downvotes
6
Downvoting Members
3
5 Commented Posts
1 Endorsement
Ranked #858
Ranked #977
~54.7K People Reached
About Me

hello...m avinash..pursuing my degree in Computer Science and engineering from durgapur,West Bengal,India.I am happy to be a part of daniweb, provides me a good platform to learn and help others.
thanks to daniweb

Interests
apart from programing,i play flute & harmonium, i ve als interest in sketching.
PC Specs
C and C++. I want to learn them in very depth, but programming is not C/C++/JAVA, it is logic and algo.
Favorite Tags

82 Posted Topics

Member Avatar for pvbhargav
Member Avatar for Sun_5
-1
15K
Member Avatar for Anil2447

[B]BUBBLE SORT[/B] Algorithm written for bubble sort is completely different. In bubble sort the largest number is in the last position(in case of arranging it in ascending order).,for the first loop j will compare till last and for second i loop j have to compare one loop less because last …

Member Avatar for Talha_5
0
9K
Member Avatar for cutedipti

Ummmm self refrential structure is basically nothing but referring to a structure of its own type. [CODE] struct node { int data; struct node *next; }; [/CODE] In the code above , a pointer is used . Pointer is used for storing either a valid address or NULL. here next …

Member Avatar for mungara
0
1K
Member Avatar for cse.avinash

Hello every one Can I have a better algorithm to find the nth prime number, where 1<= n <=5000000. for e.g., 1st prime number is 2. 10th prime number is 29. 100th prime number is 541. 1000th prime number is 7919. 10000th prime number is 104729. 100000th prime number is …

Member Avatar for vantrendin
1
6K
Member Avatar for amrita111

Macros and External Variables are really two different things:- [B]Macros[/B] are preprocessor directive means they are executed before the actual compilation of code begins.They are started with #define. [B]External Variables[/B] are used for declaration of variables(local), they can be defined any where in the programs.By default value stored in global …

Member Avatar for amrita111
0
154
Member Avatar for cse.avinash

I am doing following code to get the output upto 5 decimal characters of any number inputted by user when divided by 1, I have to use typecast it with (float) , can any one tell me how this can be done without typecasting or using float constant.. int main() …

Member Avatar for cse.avinash
1
180
Member Avatar for cse.avinash

I want to fetch names and address of all my friends from facebook and store it in my system, Can AnyOne tell me how this can be done with html, php or anything...I don't have any idea for this..

Member Avatar for pritaeas
0
195
Member Avatar for cse.avinash

I am a newbie to php and learning now, can you please help me telling how can I take inputs from users in pHp instead of using forms (i.e., a replacement of scanf() in php. I am solving a question to take number as a input and print that number …

Member Avatar for cse.avinash
0
229
Member Avatar for cse.avinash

I ve to sort an array according to finish time and accordingly start time should be arranged, how can we do this using predefined function qsort. Both Start time and finish time, i ve considered it be in a structure , .here is the code.. #include<stdio.h> #include<stdlib.h> int compare (const …

Member Avatar for cse.avinash
0
97
Member Avatar for zeus god

I ve gone through the book " LET US C " , there are many loop holes in the book, many wrong writings and incorrect programs in the book.(I am indian, so its a valid statement). You can go through the sticky notes in the site and C Programming by …

Member Avatar for YAMNA MIDHAT
0
239
Member Avatar for s_h_a_m

Watch the pattern carefully and think a bit. First can you code for the pattern:- * ** *** ****

Member Avatar for timetraveller92
0
95
Member Avatar for collinskawere

its because output screen is not holding, it's displaying output and goes off..you can use scanf("%c",&hold); before return 0 to hold the screen. and carefull don't forget to declare hold variable as char. check this:- [CODE] int main(){ char as; /*your code......... ..................... .......................... ........................... ............................ */ scanf("%c",&as); return 0; …

Member Avatar for siskaj
0
141
Member Avatar for vinodhsml

check this line instead:-- [CODE]for(i=3; i<=a/2; i=i+2) [/CODE] it will decrease the time complexity, I have checked this for few numbers and this is working.

Member Avatar for reojavier
-1
133
Member Avatar for whitech

Think of this:-- Q)Find all divisors of 80. soln:- all divisors of 80 are:- 1,2,4,5,8,10,16,20,40,80 notice the fact:-- it can be written as:-- L.H.S R.H.S 1 * 80 2 * 40 4 * 20 5 * 16 8 * 10 notice LHS elements are less than 9. i.e., sqrt(80)=8.xxx equivalent …

Member Avatar for cse.avinash
0
202
Member Avatar for cse.avinash

Hello everyone I am trying to apply [URL="http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes"]Sieve of Eratosthenes[/URL] in program, but its not working. Here is my code:-- [CODE] #include<stdio.h> long long arr[10000]={0}; int main() { long long i,j,num,inc=2,m=0; num=5000; for(i=0;i<num;i++)arr[i]=i; for(i=2;i<=num/2;i++){ if(arr[i]>0) { for(j=inc*i;arr[j]<=num;j=j+i) arr[j]=-1; inc++; } } for(i=0;i<num;i++)printf("%lld ",arr[i]); printf("\n"); return 0; } [/CODE] This code …

Member Avatar for cse.avinash
0
102
Member Avatar for sunn shine

whenever there is queue, there is fifo rule.. first think what actuatlly happens in a queue, when there is no patient , counter is empty, first position is zero as its last position. when a patient comes starting position as well as last position becomes 1. now when 2nd patient …

Member Avatar for WaltP
0
116
Member Avatar for Aman6o

conclusion of bitwise operator:-- a<<b is equivalent to a*(2^b) and a>>b is equivalent to a/(2^b)

Member Avatar for cse.avinash
0
1K
Member Avatar for challarao

Segmentation fault is due to an attempt of access of an area of memory that is not allowed to be accessed. Common causes are:- Improper format control string in printf or scanf statements. Forgetting to use & on the arguments to scanf. Accessing beyond the boundaries of an array. Failure …

Member Avatar for challarao
0
373
Member Avatar for cse.avinash

hello daniweb.. :) I am learning JAVA and currently new to it, I am studying "The Complete Reference-JAVA" by Herbert Schildt. In that book its written that using short or byte will save space, but there is no guarentee that Java won't promote those types into int internal anyway. Remember …

Member Avatar for JamesCherrill
0
113
Member Avatar for guidely

structure is good option, you should learn it but array of pointers can also be used....

Member Avatar for cse.avinash
0
253
Member Avatar for Uni

For [CODE] 1. input = " Mary had a little lamb."; 2. output = "", "", "Mary", "", "had", "a", "little", "lamb."[/CODE] and [CODE] 1. input = "a b- c d"; 2. output = "a", "b-", "", "c", "d"[/CODE] what pattern I am noticing is that:- 1) There is a …

Member Avatar for Uni
0
127
Member Avatar for Ich bin würdig

your code does n't seems to give right output.. for prime factorization you should search for sqrt(n) method, where n is number whose prime factorization is to be found

Member Avatar for rubberman
0
236
Member Avatar for compzets

compzets:- We are not here to check full codes if you are not specifying your problems.what do you want..?? positing the same code doesn't make a clear idea to us again about your problem. [B]SPECIFY YOUR AREA OF PROBLEM[/B] [QUOTE]hey buddy if u r not aware of c programming language …

Member Avatar for cse.avinash
0
193
Member Avatar for virendra_sharma

n=4. 2^4= 2 * 2 * 2 * 2; 2 is multiplied four times. You can use a loop from 1 to n to multiply 2 to n times. now % is modulas operator which gives the remainder part i.e, a % b = R as a=b*d + R for …

Member Avatar for Mouche
0
136
Member Avatar for Leaningnew

ironic behaviour of scanf() :-- user have to take 5 input i.e, press 5 y's one by one like that y y y y y [CODE] #include<stdio.h> int main(void) { int i=5; char ans; do { i++; scanf("%c",&ans); }while(ans=='y' || ans=='Y'); printf("%d",i); return 0; } [/CODE] as user will press …

Member Avatar for cse.avinash
0
107
Member Avatar for geeksforgeek

What I am analyzing(as Narue told not to do that,but due to curiosity i did) is that, for the parenthesis part a's value is assigned to b, but b outside a is not assigned i.e., it's not containing the value that is done in parenthesis. so it's (b) containing the …

Member Avatar for geeksforgeek
0
203
Member Avatar for neeraj goswami

A structure is a collection of one or more variable , possibly of different types,grouped together under a single name for convenient handling. For the first time,I am seeing such a use of structure.. Can you please explain me your code. possibly what I understand is, you are trying to …

Member Avatar for neeraj goswami
0
283
Member Avatar for linux

x is always storing some value,for the next do while loop so better you do:- [CODE] int persistence( int input ) { int digit, x , persist = 0; while ( input > 9 ) { [B]x=1;[/B] do { digit = input % 10; x = x * digit; input …

Member Avatar for linux
0
123
Member Avatar for bckc

[QUOTE]Heres a program I wrote, I'm including this to show how nooby I am in C, I really am a complete begginer :/[/QUOTE] Since you are asking about books only , its not necessary to include these type of sentences and programs to show that you are a beginner , …

Member Avatar for cse.avinash
0
178
Member Avatar for niyasc

*(b+n) equivalent to b[n]; *(*(b+n)+j) equivalent to b[n][j]; **b will store the address the address of any pointer or an array. I am little confused with your code...! Can you please explain me what all these thing means..??

Member Avatar for niyasc
0
252
Member Avatar for anujthefuhrer

yep as told by mike. The user program never sees the real physical address. The program create a pointer to location created by CPU(called virtual or logical address), store it in memory, manipulate it and compare it with other addresses. The memory mapping hardware converts logical addresses to physical address. …

Member Avatar for doug65536
0
846
Member Avatar for dev90

dev90: There's mistake in your logic:--it will also not work for N=2,4 i.e, even numbers. because for N=6 when i=0 j=5, i=1,j=4, 1=2,j=3, i=3,j=2, i=4,j=1, i=5 j=1, what is been seen here is that the array elements are swaped twice for the first half half part, array is reversed and …

Member Avatar for Narue
0
3K
Member Avatar for deva89

You need to practice questions on loops , first try to solve basic problems patterns and then step up to high level, little practice will make you clear about the ideas of loops and you will visualize the functionality , working and code just by seeing the pattern. Good luck..

Member Avatar for NP-complete
0
182
Member Avatar for cse.avinash

Hello..! I am newbie to java and I have got frustrated using notepad, can anyone please suggest me a good compiler for java. I am using Windows 7 as O.S.

Member Avatar for hszforu
0
110
Member Avatar for cdudefire

[QUOTE]if (sumd=7,11)[/QUOTE] line 18,22,26,34, for or operation the condition will be like this:- [CODE]if(sumd==7 || sumd==11)[/CODE]

Member Avatar for cdudefire
0
2K
Member Avatar for gauravrishi

sizeof() is used to calculate the sizes of datatypes, in number of bytes. It returns the size of the type of the variable or parenthesized type-specifier that it precedes as a size_t type value. sizeof can be applied to all datatypes, be they primitive types such as the integer and …

Member Avatar for cse.avinash
0
186
Member Avatar for meli123
Member Avatar for tkud
0
106
Member Avatar for sharma89bunty

We are not here for doing any one's homework. You have to write the code on your own. However for the logic part there will be two loops i and j i loop is for row, and j loop is for column. Hope you know about matrix, just figure out …

Member Avatar for Ancient Dragon
0
97
Member Avatar for sydsine

Yup as told by Ancient Dragon, atoi()converts a string into an integer and atof->string to float. Are you trying to do this:--;) [CODE] #include<stdio.h> int main(void) { char a[]="90"; int c; c=atoi(a)/3; printf("%d",c); return 0; } [/CODE]

Member Avatar for cse.avinash
0
452
Member Avatar for techie929

Your code doesn't seems to work in my compiler Dev C++, with or without int n. which compiler are you using.?

Member Avatar for techie929
0
110
Member Avatar for Master Mascus

Yup I think you are stucking in taking input as spaces, since you are using scanf().

Member Avatar for Master Mascus
0
169
Member Avatar for thamilalagan

Ummmm this is called self refrential structure which is basically nothing but referring to a structure of its own type. [CODE] struct node { int data; struct node *next; }; [/CODE] In the code above , a pointer is used . Pointer is used for storing either a valid address …

Member Avatar for cse.avinash
0
83
Member Avatar for fullarmorzz

[QUOTE]int a[10];[/QUOTE] is an array of integers which will store 10 elements and you don't need to store values in different elements. a[0] to a[9] = 10 elements. [QUOTE]for(i=0;i<10;i++)[/QUOTE] basic syntax:-- for(initialization;condtion;increment/decrement) is a loop which start from i=0 till i reaches 10 means the block will execute 10 times …

Member Avatar for ashok1514
0
203
Member Avatar for cse.avinash

In the book "The Complete Reference-JAVA" by Herbert Schildt. Its written there that "In C/C++, char is an integer type that is 8 bit wide and char in JAVA is a unicode 16 bits wide." I ve understud the point but I want to ask that char in JAVA isn't …

Member Avatar for JamesCherrill
0
92
Member Avatar for cse.avinash

In C, array is sequence of variables. int arr[3]; if arr is 2000 then arr+1 is 2000+sizeof(int). lly arr+2 is 2000+2*sizeof(int). in that way array elements are accessed but in JAVA array elements are dynamically allocated using new. then how all others variables are accessed, means I want to ask …

Member Avatar for JamesCherrill
0
163
Member Avatar for cse.avinash

hey I am having confusion in the output of a simple program. here is the code:- [CODE] int main(void) { printf("%d %d",sizeof('A'),sizeof("A")); return 0; } [/CODE] output on my compiler(gcc):- 4 2. I thought sizeof("A") is considered as string ending with '\0' so there are two characters i.e,2 bytes a …

Member Avatar for gerard4143
0
97
Member Avatar for shaunchu

when You write zero before any decmial number, compiler will automatically convert that number into its octal form , check the code:- [CODE] #include <stdio.h> int main() { printf("%d",057); return 0; } [/CODE] however i tried a lot to understand your code but i cant get why you are using …

Member Avatar for cse.avinash
0
113
Member Avatar for geeksforgeek

there are basically 5 data types in C. Int, Char, Float , Double and Void. The type Void either explicitly declares a function as returning no values or creates generic pointers. when we declare [CODE] int i; int *p; p=&i; [/CODE] when we declare p as an integer pointer means …

Member Avatar for geeksforgeek
0
123
Member Avatar for saurav2007

Yup as told by gerard4143 and asit mahato. Saurav:-Don't get confused by seeing negative sign as output. for eg:-- [CODE] main() { int i = 449; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );} [/CODE] output is -> -63 1. As binary of 449 is 00000001 11000001 for 11000001, …

Member Avatar for saurav2007
0
123
Member Avatar for challarao

i++ is same as i=i+1, and its required as per conditions of program. inbuilt thing unable to get your words. Machine only understand the thing which we perform and follow our instructions. if i=0 then how it will increment automatically as machine is not having any sense until we tell …

Member Avatar for challarao
0
145

The End.