Answer #2: You have assigned the elements of the array in
the program itself which by default starts from array index
0 that is the numbers goes into the array indices 0 1 2 3
4 and you have not initialzed or modified the value of i in
the first loop which happens to be a garbage or 0 so the
count goes to infinite. coz a[i] is never '\0'
Secondly in a numeric array last element in not null
character it is only in case of character arrays.
Assuming that you have implemented the 1st loop correctly
and you have the length of array a in count ie = 4 since u
are starting from 0 then you have initialized i to count
which makes i = 4.In the second loop the condition is i>=1
so i=0 is never visited and thus a ir not displayed
(remember in C array starts from 0 by default).
printf("Enter a number");
printf("squre of %d is %d",num,num*num);
printf("\nwant to enter another number y/n");
the above code runs only one time.on entering 'y' the
screen disappeares.what can i do?
There are 8 billiard balls, and one of them is slightly
heavier, but the only way to tell was by putting it on a
weighing scale against another. What's the fewest number of
times you'd have to use the scale to find the heavier ball?
How to print all the 26 alphabets in this order in C.
it should print dynamically from a to z and do not print
this using pgm like this print("Ab......");
Use loops or anything to print all alphabets