What is wrong with this C++ program?
#include
What is wrong with this program?
Like others have mentioned, char *r is not initialized. But I think there are other points worth mentioning.+ You shouldn't use that function "gets". It's okay in small program like this, but in bigger programs it can cause buffer overflow, because the "gets" function doesn't recognize the size of the string(as you can see, you didn't even assign a size to char *s). You can test this by creating two arrays with sizes, then using the "gets" function to enter two oversized string, and printing them.+ You don't really need that "strcat(str,"\0")", the function "gets" (or "fgets") already puts NULL at the end of the string.+ Maybe this is just me, but this program doesn't reverse the original string, it just print the reversed (which is stored in a different place). You can try swapping the characters
Whats wrong with this program in c++?
C++ is case sensitive. Try this: int main() { int score = 1000; float rScore = score; return 0; }
What's wrong with this C program?
Added 2016–11–29:Dear Sadia Ahmed,Now that there is a “source code,” we might be getting somewhere! There are several things wrong, where to begin? Syntax is clearly not your strong point!Item: the for loop is syntactically incomplete.Item: “uid=id[i]” is an assignment. You probably want a comparison (==)Item: “else{answer=0;}” is questionable: Initialize answer (to zero), and remove the else clause (since you break the for loop when setting answer to 1).Item: No file is accessed in the code shown.Item: the given source has a whole lot of declared but unused arguments.Good luck … What’s the context? Programming class?
What is wrong with this program?
Rewriting your mistakes:#include
What is wrong with my C++ program?
Please read the error message. It has the very answer you want :-)Error Message: “
What is wrong with this program in Java?
First, you should notice the error message which helps you find out what is wrong with your code. Try to solve it by yourself, debug is an important skill for a coder.this program does have some syntax error. Like the “continue” should be used in a loop structure.And about this statement: “if (num / counter == 1);” you have to delete the semi-colon.Afterwards, this program is ready to run without syntax bugs. As to the logical bugs, it is up to yourself to figure it out.
Whats wrong with the program, the program is in the comments?
#include
What is wrong with this java program?
I'm writing a java program to change all the small letters in an inputted string into caps, and vice versa import java.io.*; public class smalltobig { public static void main(String []args)throws IOException { BufferedReader keyin=new BufferedReader (new InputStreamReader (System.in)); String inp; int cnt = 0;int ctr = 0; int z = 0; char c = ' '; char d = ' '; String small = "qwertyuiopasdfghjklzxcvbnm"; String output = " "; System.out.println("enter"); inp = keyin.readLine(); z = inp.length(); for(cnt = 0;cnt < z;cnt++) { for(ctr = 0;ctr < 26;ctr++) { if(inp.charAt(cnt) == small.charAt(ctr)) { c = Character.toUpperCase(inp.charAt(cnt)); output = output + c; break; } else { d = Character.toLowerCase(inp.charAt(cnt)); output = output + d; break; } } } output = output.trim(); System.out.println(" new String is " + output); } }
What is wrong with my Pascal Program?
is rter pascal this eyar at schooladn i am trying to make a simple program.this is a small quiz which will only ask the user 1 question.if the answer is 1 it wil display correct if not, wrong. pls tel em what i did wrong and what i need to do fro ti to work. here isthe program: Program quiz; uses crt; var answer:string; begin writeln('Welcome to the quiz'); clrscr; writeln('question 1:'); writeln('what is my name?'); writeln('1:Robert'); writeln('2:Daniel'); writeln('3:James'); readln(answer); if(answer=2)then writeln('corerct!'); else writeln('Wrong!'); readln; end. Another thing.i am plamnning to put more questions. do i need to add more variables or do arrays?or there is no need and i can keep on working on the varibale 'answer' on other questions? Thanks a bunch!