I'm sorry for posting it like crazy I'll work on it more and ask more precise questions..
Type: Posts; User: Sid_TheBeginner
I'm sorry for posting it like crazy I'll work on it more and ask more precise questions..
Hello Guys. Please help me code this practice problem. Its from Alex Allain's Jumping into C++. A really cool book :)
© Alex Allain (C programming.com - Learn C and C++ Programming -...
So this happens only with the %c specifier if I got it right. Am i correct?
Michael Pont's Embedded C may be helpful. He uses the 8051 microcontroller only in his book.
scanf(" %c", &answer); // this code is getting skipped
That's totally amazing for me. Could you tell me the reason behind that. :confused:
Thank You very much rags_to_riches and qny
Hello guys. Here's my code. I want to average the numbers entered by the user.
#include<stdio.h>
#include<ctype.h>
int main(void)
Hello guys. I'm getting this error:
a.c: In function main:
a.c:10:2: error: expected ;, identifier or ( before int
make: *** [a] Error 1
I'm not able to figure it out. Please help....
Thanks for all the help guys. I've come up with this:
#include<stdio.h>
int main(void)
{
char abc[] = {"Mmy Nname Iis Mmonk"};
int i = 0;
The exercise demands to achieve it using math. I want to skip all the uppercase case letters.
That means all characters between and including A and Z :confused: is it
(abc[i] >= 'A' || abc[i]...
isn't the 'A' and 'B' used to pass throught the ASCII table values? Hence avoiding all the Uppercase letters? :confused: Thank You for your reply
Here's my code. Please help.
Thanks in advance.
#include<stdio.h>
int main(void)
{
try using a simple if else looping. The Final else must say please enter a valid value. switch is also one better way.
Worked! I've replaced the for with a while loop in the function!
Thanks,
--Sid
In the above code I posted, I'm not able to print "Not FOund" when a number not present in the array is tried for... And could you please post the syntax for how to clear the stream?
Thanks,
--Sid
Thanks for the reply.
Can you please look at this code and let me know?
#include<iostream>
using namespace std;
int BinSearch(int data[], int numElements, int searchKey); // Prototype
Thanks for your reply! I'm now returning -1 outside the for loop in the BinSearch function but I'm not able to figure out how to print a message using that return value -1 :( And stringstream...
I've got the logic right and the algo seems to work fine. Now, that's epic for me
But..
I want to add 2 more features to this code:
1) Exit on pressing 'x'. For now I'm using -1 to exit.
2)...
Thanks for your reply Sir. Indentation was fine before pasting it here.
So my logic is terribly wrong?!! :( Maybe I should slow down my learning speed. Can you please recommend any good book to...
My Code is'nt able to find the index value if the 1st or the 2nd element of the array is checked for. Here's my code.
Also i want to exit on pressing 'x' For now, I'm using -1 to exit.
...