473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

please help me.this what i write but it gives me error.

/*header file declare*/

#include<stdio.h>
#include<conio.h>

void main(){
/*Declare local variable*/
char ch;
int valuea;
int valueb;
int output;

/*user enter symbol*/
printf("Enter the symbol : ");

do{
scanf("%c",&ch);

/*wrong input , will notify the user*/
if(ch!='+' && ch!='*' && ch!='-' && ch!='/'){
printf("Invalid symbol , Please enter correct symbol \n");
}
}while(ch!='+' && ch!='*' && ch!='-' && ch!='/');

/*Enter first value*/
printf("\nEnter vallue A :");
scanf("%d",&valuea);

/*Enter second value*/
printf("\nEnter vallue B :");
scanf("%d",&valueb);

/*perform operation for output*/
if(ch=='+'){
output=valuea+valueb;
}
if(ch=='-'){
output=valuea-valueb;
}
if(ch=='*'){
output=valuea*valueb;
}
if(ch=='/'){
output=valuea/valueb;
}


/*print final answer */
printf("\n\n%d %c %d = %d",valuea,ch,valueb,output);
getch();
}
Oct 6 '15 #1
2 1147
donbock
2,426 Expert 2GB
What error do you get?
Oct 6 '15 #2
weaknessforcats
9,208 Expert Mod 8TB
Also, do you get this error when you compile the program or when you run it?
Oct 6 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: eje | last post by:
IsNumeric(value) should return false if value "can not be successfully converted to a Double." Instead I get the following error message: "Input string was not in a correct format." I use the...
6
by: vips | last post by:
Page_Load datagrid1.datasource=dataset1 //I am filling the datagrid and it works fine when page is displayed end ---------------
0
by: Pixie | last post by:
We are successfully getting a handle to a drive using createfile then using that handle to query the change journal using DeviceIOControl with the paramter FSCTL_QUERY_USN_DATA. However when we try...
33
by: Martin Jørgensen | last post by:
Hi, In continuation of the thread I made "perhaps a stack problem? Long calculations - strange error?", I think I now got a "stable" error, meaning that the error always seem to come here now...
12
by: arnuld | last post by:
in C++ Primer 4/3 Lippman says in chapter 3, section 3.3.1: vector<stringsvec(10); // 10 elements, each an empty string here is the the code output & output from my Debian box running "gcc...
2
by: mrsgwen90 | last post by:
I am trying to update a record using access as the front end and VB 6.0 as the backend. I am using a SQL statement to accomplish this. But I am getting the "Write Conflict Error". I have tried...
4
by: Abubakar | last post by:
Hi, I'm working on an application whose code was written by some other developer and I dont completely understand its source code right now. In one of the pages where I'm writing a test code, at...
2
by: kkshansid | last post by:
I dragged text box and write in data/control source = & "," & Chr$(13) & Chr$(10) & & Chr$(13) & Chr$(10) & but it gives error that #name? in layout view kindly help to resolve the problem...
0
by: rahulsankhe1089 | last post by:
I am using below javascript <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script> <script type="text/javascript"> ...
3
by: rahulsankhe1089 | last post by:
i have created web application in asp.net using visual studio 2010. i did coding in vb.net. in vb.net code i used simple message box. it does not give error when i run project through visual...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.