i already searched online before creating a new thread here. Most of the pages were just complicated for me to understand.
Thanks. I will keep trying, hope I will get something easier.
Type: Posts; User: learning_grc
i already searched online before creating a new thread here. Most of the pages were just complicated for me to understand.
Thanks. I will keep trying, hope I will get something easier.
HI Jim,
How can I do the sorting? Can you please post a sample code?
FYI: I'm just a beginner for programming
I have a code as shown below, which produces output as below
83,72,91,42,0,78,92,81,68,0,82,55,36,22,11,
but actually I want output in ascending order like...
when I run the below code, only the indice[3][4] output it displays weird. Everything else fine.
#include <iostream>
#include <conio.h>
using namespace std;
int main ()
{
I have two concerns in the below code.
(1) If I replace gets (str1) with scanf (%d, str1) it doesn't work.
(2) I entered first string as "tina" and second string as "leena is god" so the first...
Of course, I'm still confused but I hope soon I will get it clear. Thanks to all of your(everyone in this thread) answers.
Thanks again. Of course I understand the importance of indentation.
As to bracket. I already tried removing bracket. It gives the output in one line if I remove bracket.
But I wonder then why...
In the below code, I'm wondering why bracket is put between the for statements. And why we need to put printf (n) as a separate statement.
{
for (j=0; j<c; j++)
printf ("%d\t",...
@commontater
yes it's working but I never thought about to try in that way because I learned in scanf we must use the symbol "&" after comma.
Thanks CommonTater. I will learn slowly indentation also.
@jimblumberg
value of n is 2 and c is 2
And line 17 is matrix[2][2] in original source.
The code below prints -29368 as output at the end if I enter order of matrix 2 and 2 AND Value of matrix as 1,2,3,4
I wonder what that -29368 refers to? is it memory address or anything else?
...
No, the input entered is just two words like "room", "table". It was showing some weird output....but when I replaced scanf with gets(str1) and gets (str2). It works perfect.
Thanks again. But what does that mean "initialize the array to 2". Does it mean [2][2] array?
In the below program, I wonder what it means by a[i][j]=2 and why they have used this. Does it mean value of a[i][j]=2, then how come that value..i'm confused
int main (void)
{
int...
@bernt,
Thank you but I cannot understand what you mean.
@king mir
I tried putting 29 as you suggested but still it didn't work.
The below program don't work. I don't know why. Please help
#include <stdio.h>
#include <conio.h>
#include <string.h>
int main ()
{
char str1[30];
char str2[30];
The code below supposed to provide
str1 = ilikeyou.c
str2 = .com as str2 should not affect by strncat command
but it shows str1 = iloveyou.c and str2 = c
I wonder why str2 is only c when it...
Hi,
I'm just new to c learn. In c examples I sees that sometimes they use void main () as main function and sometimes int main();
Is there any difference between them?
And I know they don't...
Could you please tell me what the code below is exactly doing?
particularly I'm confused about a[i][j]=2.....what is this??
And in last line for which data type they used "%8u" and something ...
@manasij
i want to learn "goto function"........
I wanted to display "www.iloveyou.com" using the following command but it shows "ilove.comyou" . I don't understand what is the problem.
int number;
printf ("www.");
goto x;
z:
printf...
Thank you friend. But in the source it was image. Anyway, I typed now in notepad and made copy paste here
int main()
{
int matrix[3][3],i,j,r,c;
clrscr ();
printf ("Enter the order of...
I tried to understand C array from various sources and then looked into the codes below but I cannot understand it. Can you please tell me what the code exactly does and what they meant to write?
...
The below code results only 1,2,3,4,5 as output.
I wonder why not "6" as it is written if==6
http://s2.postimage.org/ywhcikrrd/c_example.gif