406 Posted Topics

Member Avatar for Demonisya

Firstly... [code=syntax] for(b=0,b<=a,b--) { printf("The Numbers in Descending order:%d\n",b[a]); } [/code] is wrong.As you can see you are starting b's count from 0 and doing a b-- operation. Secondly... You need some sorting mechanism to sort your arrray.The simplest to understand may be selection sort to start with.

Member Avatar for its.romi
0
412
Member Avatar for lonely_girl

[QUOTE=lonely_girl;792050]ok i need a little guide about my program.. How i take my start? taking the current year,current month,current date,birth year, birth month, birth date input and giving the age in the form of "years-months-days" suppose "18 years-2months-21days"...[/QUOTE] You can take "18-2-21" as a string input into string str and …

Member Avatar for csurfer
0
1K
Member Avatar for flipjoebanana

In my view the usage 'echo helloworld > newfile.txt' within a 'C' program is limiting the redirection operator and as a result it is also being treated as as a simple '>' text character, which on echo prints the output 'helloworld > newfile.txt' to the stdout. You need to look …

Member Avatar for csurfer
0
79
Member Avatar for lonely_girl

Loops are always better than goto but with goto I think this can be done: You may also use another variable by the name cnt which would hold the number of times you want to re-run the program in case of a wrong input symbol and alter the code as: …

Member Avatar for lonely_girl
0
140
Member Avatar for sarawilliam

[QUOTE=sarawilliam;789986]Hi I want to know how we can measure C execution time by seeing the clock cycles generated from the assembly code. Thanks...[/QUOTE] I cannot assure you of this method but it had worked for me.The time.h header file has some variables as CLK_TCK and a data type which you …

Member Avatar for Narue
0
204
Member Avatar for mohan_198505

All these cant be done in scanf itself so you can make some changes in ur prog to implement them n then move forward which would give the image as if the input is so.... #include<stdio.h> #include<ctype.h> int main(void) { char str[15]; scanf("%[^\n]",str); str[0]=toupper(str[0]); str[15]='\0'; printf("%s",str); return 0; }

Member Avatar for Aia
0
116

The End.