No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
One of the questions given to us for the lab exam was to generate the first 10 armstrong numbers. I could generate upto 5 numbers correctly..the rest are wrong. [code] #include<stdio.h> #include<conio.h> void main() { int n=1,a,b,i=1,r; clrscr(); while(i<=10) { a=0; b=n; do { r=b%10; a=a+r*r*r; b=b/10; }while(b>0); if(a==n) { … |
|
In the recursion tree method of solving recurrence equations.. why do we try to find an upper bound on the number of leaves (or the total cost of the leaf nodes). In most of the recursion tree examples we usually find the level by level sum to infinity.. what's the … |
|
I just want to know the exact difference between intialising and assigning a variable. Is it possible to initialise a variable multiple times in C prog or is it just initialise once n assign all the other time...can somebody help me out please. |
|
Is there a difference between keywords and reserved words? Is main() a reserved word? |
|
[code] #include<stdio.h> main() { int a=1; switch(a) { case isdigit('1'):printf("Hello"); } }[/code] This code works fine Hello is printed [code] #include<stdio.h> main() { int a=1; switch(a) { case isalpha('a'):printf("Hello"); } }[/code] But this code gives an error It says case label does not reduce to an integer |
|
[code]main() { int a=5; a=++a + ++a; printf("%d",a); }[/code] the output is 14..how come? |
|
I got this question in a competitive exam i wrote today...n i was just curious if my answer was right. The Question is : Let G be a complete undirected graph on 6 vertices. If vertices of G are labelled, then the number of distinct cycles of length 4 in … |
|
Is this proof right?? Claim: Let #0(w) and #1(w) be the number of 0s and 1s in w, respectively. Then A = {uv ∈ {0, 1}∗ : |u| = |v|, #0(u) = #1(v), and #0(v) = #1(u)} is not a regular language. Proof : Say there is some pumping length … |
|
The following snippet finds the least, greatest and sum of the elements of an array. It works when I give the test condition with variable "i" in the for loop (as in the first snippet). But when I replace it with a pointer(as in second snippet), it gives a wrong … |
|
Re:
hii... im new to this web community.At present im working with Infosys on DOTNET platform.....I hope i will get benefit out of this n not only that please post me some interesting questions so that i can find solutions to those n brush up my skills..thnx a lot for this … |