473,386 Members | 1,706 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,386 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 1146
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.