473,387 Members | 3,821 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,387 software developers and data experts.

i get a fatal error c1075 and can't find where i need to add another curved bracket

Expand|Select|Wrap|Line Numbers
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <stdio.h>
  3. #include <conio.h>
  4. void main ()
  5. {
  6.     int month,year;
  7.     int days,weeks,left;
  8.     char x;
  9.     float a,b,c;
  10.     do
  11.     {
  12.     puts("Please enter:\nL to solve a linear equation\nD to calc the num of days in month\nW to calc the num of weeks and days");
  13.     fflush(stdin);
  14.     scanf("%c",&x);
  15.         while (x!= 'L' && x!='D' &&x!='W')                
  16.     {
  17.         printf("Please type (L or D or W)\n");
  18.         fflush(stdin);
  19.         scanf("%c",&x);
  20.     }
  21.     switch(x) 
  22.     {
  23.         case 'L':                                    
  24.         puts("Please insert equation ax+b=0 argument (float): a ant than b");
  25.         fflush(stdin);
  26.         scanf("%f%f",&a,&b);
  27.         if (a==0 && b==0)
  28.             printf("there is infinity sulotions for the linear equation: %fx+%f=0 ",a,b);
  29.         else if (a==0)
  30.             printf("there is no sulotion for the linear equation: %fx+%f=0 ",a,b);
  31.         else
  32.         {
  33.             b=b*-1;
  34.             c=b/a;
  35.             printf("\nThe single sulotion for the linear equation is: %f\n",c);
  36.         }
  37.         break;
  38.         case 'D':                                            
  39.         puts("Please enter the month (1 - 12) and the year");
  40.         fflush(stdin);    
  41.         scanf("%d%d",&month,&year);
  42.         while (month > 12 || month < 1)                        
  43.         {
  44.             puts("No man! Please enter the month (1 - 12) and the year");
  45.             fflush(stdin);    
  46.             scanf("%d%d",&month,&year);
  47.         }
  48.         if (month==2)
  49.         {    
  50.             if (year%4==0,year%400==0)
  51.                 printf("The num of days is 28\n");
  52.             else
  53.                 puts("The num of days is 29");
  54.         }
  55.         else if(month<=7)
  56.         {
  57.             if (month%2==1)
  58.             puts("The num of days is 31");
  59.             else
  60.             puts("The num of days is 30");
  61.         }
  62.         else
  63.         {
  64.             if (month%2==0)
  65.             puts("The num of days is 31");
  66.             else
  67.             puts("The num of days is 30");
  68.         }
  69.         break;
  70.         default:                                            
  71.         puts("Please enter a num of days");
  72.         fflush(stdin);
  73.         scanf("%d",&days);
  74.         while (days<0)
  75.             {
  76.                 puts("Please try again to enter a positive num of days");
  77.                 fflush(stdin);
  78.                 scanf("%d",&days);
  79.             }
  80.         weeks=days/7;
  81.         left=days%7;
  82.         printf("The num of weeks is: %d and the num of days is: %d\n" , weeks ,left);
  83.         break;
  84.     }
  85.     puts("\n\npress any key to finish . . .");
  86.     _getch();
  87.     printf("\n===========================================================\n\n");
  88.     puts("\n\nGood bye and thank you, hope you enjoyed with my prog, dog.\n\n");
  89.     }
  90.  
Nov 10 '10 #1
1 1509
donbock
2,426 Expert 2GB
In the future, please provide the full text of the compiler error message. That would make it a lot easier to help you.

I don't know if these issues are related to this error, but ...
  1. Lines 26 and 35: the variable types are not consistent with the format string.
  2. Lines 26, 41, 46: you may need a separator between the two numbers.
  3. Line 50: the if-condition is illegal.
  4. Lines 13, 18, 25, 40, 45, 72, 77: I'm not sure, but I think flushing stdin yields undefined behavior.
Nov 11 '10 #2

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

Similar topics

6
by: MLH | last post by:
"The following unexpected error occurred in Sub CopyMySQLbttn_Click, line #250, CBF on frmVehicleChooserform. 2465: "Can't find the field 'forms' referred to in your expression. You may have...
1
by: K7211 | last post by:
Hi, I've been trying to use Visual C++.NET, but whenever I try to build a solution I get this error message, fatal error C1108: unable to find DLL: 'alink.dll' Does anyone know what causes...
5
by: meenasamy | last post by:
Hi all i have used a script that i downloaded and uses the fopen($url,'r'); function to access a url to retrieve data and i get this error Fatal error: fopen(): Unable to find the wrapper...
10
by: Richard Lewis Haggard | last post by:
I've created in form that has tab controls that contain tab controls that host user controls on each tab page. It compiles and runs just fine but the designer view fails with a "A circular control...
2
by: PW | last post by:
Hi, What the heck is that supposed to mean? I am getting this error on a "Me.Requery" line in a subroutine on a form, but only when I select something from a combo/dropdown box. The *exact*...
0
by: imu | last post by:
hello, please help !!!!! my huge 1.3gb database is curropted. try to repair it with command repair table table name but it can't work i have only .MYD,.MYI.frm back up file. so please how i...
6
tpgames
by: tpgames | last post by:
This code works how I want it too work. 2 letter quiz This code does not work how I want it too. The links refuse to load up in the frame no matter what I change the 2.html link to be. 2.html ...
10
by: Sami Ward | last post by:
I have an an MSAccess data project front end linked to an SQL Server Database. I keep getting Error number 7874: database cannot find the object tblname when I look however the table is there. I...
10
by: dstorms | last post by:
Hi, I'm trying to create a button on a form that: 1. Takes the ComputerID from the form linked to Table 1, 2. Checks Table 2 for a matching ComputerID, and 3. Opens the query qryEditData, and...
1
by: Jim Rockett | last post by:
"if(CURVE(RESD) < 0.001 ? 0.001 : CURVE(RESD))"
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.