The Alphabet: a, b, c
I'm trying to define a PDA which accepts
a^n b^m c^p : n + p = 2k for some integer k, m = k, and n, m, ...
|
I have to print a certain number of blank spaces to stdout, but this number is not fixed. I'm using putchar(), but I'm not sure if this is fast. What is ... |
Just your standard C primer program. I'm trying to print out a histogram of all the different characters that a user inputs as a string.
#include <stdio.h>
#define LIMIT 255
main(){
int asciiArray[LIMIT], input, outer, ...
|
I have a string which has this:
((12+41)*30)
here 12, 41 and 30 are all characters. How do I do arithmetic operations on them ?
Also when I have a number 20 how can ... |
Looks like the OP wants to parse floating-point numbers. If so, then I'd suggest copying the input characters into a string and using strtod to parse the string. If upon return, endptr points to a string of zero or more whitespace characters then the input string must have been a valid floating-point number. However, I'm not sure what strtod does if ... |
Hai friends.... In C for 97=A character , 65=a charcter....can u tell what is the number for "space" character... Davidson Why do you even want to know that? A space character is simply this: ' '. Any numerical value is bound to be valid only for a certain character encoding such as ASCII or EBCDIC; if you want to sprinkle those ... |
Hi Banfa! Yes I understood what you said. so I have to get each character in the input and then make a loop to see if this character is already in result. but the problem is that I don't know the lenght of resul. so how can I make the loop. thanks for your help |
|
Hey all! Finals are over, yes! Ended up with a C in my programming class, and that is really ok with me. Like another user on here said, it is like learning another language, and I was really bad a Spanish :-) But I had a program that was assigned for homework that I never was able to figure out. Since ... |
good day sir i need to create function that limits the user on their input like if would like them to only use numbers or characters like this one but you can input lots of characters and numbers i just scooped this code from the web Code: #include #include main() { char ch; int colour, xkey; clrscr(); textmode(3); window(1,1,80,25); ... |
|
Code: int srch (STUDENT student[], char* ssn) { char Name[256]; int tempstu; while ((strcmp(ssn, "q"))) { printf("\n Please enter social security number (press q to quit): "); scanf("%s", ssn); tempstu = recSrch(student, ssn, 0, SIZE - 1); printf("\nRecord found at index %d:", tempstu); strcat(strcat(strcpy(Name, student[tempstu].fName), " "), student[tempstu].lName); printf("\n%30s %9d %13s %02d/%02d/%4d", Name, student[tempstu].grade, student[tempstu].ssn, student[tempstu].bDate.month, student[tempstu].bDate.date, student[tempstu].bDate.year); } printf("\nThank You."); ... |
|
Code: #include int main() { char *deliStevilke[]={ // numbers representet with characters "+--+", // 0 "+ +", // 1 "! !", // 2 " +", // 3 " !", // 4 "! ", // 5 "+", // 6 "!", // 7 }; int stevilke[10][5]={ // numbers how they are to be printed on the screen {0,2,1,2,0}, // 0 {6,7,6,7,6}, // ... |
tx macgyver for the answer, well 1st, i did not like quzah's answer because he's talking about failing a homework since the 1st post, what the heck ? it s not a homework, it is something that I want to learn, by my self. I am doing research online since i am having troubles with prototypes and function calling, may be ... |
|
i didnt find there nothing i wanted. i will explain my problem with more details: i am doing a program that solves a math exercises with order of arithmetic operations for example: 2*(7-6*4+(11-6)+(14-5)) now, the user types number or character(*,-,+,/) i have a struct that contains one int variable and one char variable the user types character or number and i ... |
|
I see Ancient Dragon has typed faster than I and with a more precise version of what to do. As a learning experience here's a sampling of ideas I have about your code: 1) use int main(), not void main() 2) i should be an int, not a char 2) if you use a for loop, don't place a semicolon after ... |
|
#include #include char Name[10]; int Ch = 0; void NameF() { printf("Enter Name : "); while(Ch < 10) { Name[Ch] = getch(); if(Ch > 0 && Name[Ch] == '\b') { Ch --; putch(8); } else putch(Name[Ch]); if(Name[Ch] == '\r') break; Ch++; } printf("\nName : %s", Name); } void main() { NameF(); } |
We like to help those that show some effort, especially when it appears to be an assignment. Show us what you've tried. Tell us what it does and what you expected it to do and we can help you make the two match up better. (I wouldn't be surprised to find an example program kicking around here somewhere...did you do a ... |
|
|