Thank you very much! I found that control+d
Type: Posts; User: amadeus111
Thank you very much! I found that control+d
#include <stdio.h>
/* count digits, white space, others */
main()
{
int c, i, nwhite, nother;
int ndigit[10];
nwhite = nother = 0;
for (i = 0; i < 10; ++i)
ndigit[i] = 0;
while ((c =...
Thank you very much!
for every other character other than blank, newline and tab flag turns zero and if it gets blank, newline and tab flag is still zero but inspace==0 becomes TRUE then
inspace=1 and compiler makes...
flag's initial value 1
then lets say result of "c == ' ' || c == '\t' || c == '\n'"
equals to 1
then dont we check the value of inspace if it is 0 and started with inspace was 1 thats where I got...
#include <stdio.h>
int main(void)
{
int c;
int inspace;
inspace = 1;
while ((c = getchar()) != EOF)
Oh! you called that quine. Another one got learned thanks!
I totally misunderstood copying input to output, I thought it would print out the code.
Thanks you Salem and grumpy!
#include <stdio.h>
/* copy input to output; 1st version */
main()
{
int c;
c = getchar();
while (c != EOF) {
putchar(c);
c = getchar();
}
Exactly! I wanna know what I am doing.
I would like to program games and iphone apps. What steps do u think I should follow to be a competitive game programmer ?
Thank you guys lots of good information. I have started programming b/c I didnt want to waste my time by playing games. I think creating part of programming more fun and satisfying than playing a...
I have a few questions about programming languages
1. What are the most popular programming languages ?and why?
2. To learn C++ or C# should I learn C ? and if C necessary how much of C...
I was working on my own approach. now I will check yours and learn and hopefully fix bugs and convert characters to numbers as well
thank you!
zero is not neglected anymore
if (n==0) {
printf("zero");
}
Thanks for lightening my mind after reading your comment it made perfect sense. for extra challenge, I put blanks after every 3 digit
#include<stdio.h>
#include<string.h>
#define d 9
#define e 9
#define f 4
int main()
{
char *num[]={"","one","two","three","four","five","six","seven","eight","nine"};
char...
#include<stdio.h>
#include<string.h>
#define a 9
#define b 9
#define c 3
int main()
{
char *num[]={"","one","two","three","four","five","six","seven","eight","nine"};
char...
if ur string is foo there is 6 combinations of foo 3!=6 foo foo ofo ofo oof oof. I haven't thought yet about if there is/are repeating letters. I will work on it later if I can :D
#include<stdio.h>
#include<string.h>
#define a 15
int main()
{
char str[a];
char *ptr=str;
char temp;
int i,n,j,b;
I am sorry, but I didn't understand what you mean
#include <stdio.h>
int main()
{
int d,m,y,month=0;
long int t;
printf("enter a date dd-mm-yyyy: ");
#include <stdio.h>
int main()
{
int d,m,y,month=0;
long int t;
printf("enter a date dd-mm-yyyy: ");
scanf("%d-%d-%d", &d, &m, &y);
if (d<=0||d>31) {
Thank you! It makes sense now! :) :)
#include <stdio.h>
int main()
{
char s[40], gecici;
int i, n;
printf("write a word : ");