klimi
https://www.asciihex.com/character/control/7/0x07/bel-bell-alert
shriman_deepak
#include<stdio.h> int main () { int Temp; float co=1.8; int C=32; printf("Enter the Temperatue in Celcius \n"); scanf("%d \n", &Temp); printf("Temperature in Faranheit %f \n ", co*Temp+C); return 0; }
shriman_deepak
What is wrong in this code
Hentai-kun
How can i use -1 in a while statement to break the loop
Hentai-kun
Enter miles driven (-1 to quit): 287 Enter gallons used: 13 MPG this trip: 22.076923 Total MPG: 22.076923
touhou
same issue
did you remove the trailing space in scanf too ?
shriman_deepak
did you remove the trailing space in scanf too ?
#include<stdio.h> int main () { int Temp; float co=1.8; int C=32; printf("Enter the Temperatue in Celcius \n"); scanf("%d ", &Temp); printf("Temperature in Faranheit %f ", co*Temp+C); return 0; }
shriman_deepak
actually the issue is that i have to compile it two times
shriman_deepak
i am using vs code and after entering a number in celcius variable i have to compile again
shriman_deepak
cd "d:\random\" ; if ($?) { gcc code2.c -o code2 } ; if ($?) { .\code2 }
shriman_deepak
it worked
shriman_deepak
can u please what is this white space and what kind of issue it can create @f22raptor_uwu
touhou
can u please what is this white space and what kind of issue it can create @f22raptor_uwu
https://stackoverflow.com/questions/19499060/what-is-the-effect-of-trailing-white-space-in-a-scanf-format-string
Esbol
Game engines also a frameworks, right?
shriman_deepak
#include<stdio.h> int main () { int Principal=1000,time=2,R=3; float SI = (Principal*time*R)/100; printf("Simple Interest = %f", SI); return 0; }
shriman_deepak
what is wrong with this code
shriman_deepak
it is not compiling on vs code but it can on online c compiler
shriman_deepak
finding simple interest
shriman_deepak
PS D:\random> cd "d:\random\" ; if ($?) { gcc code3.c -o code3 } ; if ($?) { .\code3 } Program 'code3.exe' failed to run: Access is deniedAt line:1 char:64 + ... "d:\random\" ; if ($?) { gcc code3.c -o code3 } ; if ($?) { .\code3 } + ~~~~~~~. At line:1 char:64 + ... "d:\random\" ; if ($?) { gcc code3.c -o code3 } ; if ($?) { .\code3 } + ~~~~~~~ + CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException + FullyQualifiedErrorId : NativeCommandFailed
Talula
It is compiling.
shriman_deepak
It is compiling.
yes on online compiler
shriman_deepak
but not on vs code
Talula
Program 'code3.exe' failed to run: Access is deniedAt line:1 char:64 Seems like your compiler doesn't have access to the folder "random".
shriman_deepak
the last programme i did get easily compiled
Talula
It is not a program issue, it is surely compiler issue, could be access or could be folder you're using.
shriman_deepak
anyone know how to stop this antivirus to delete the .exe file of vs code and why do it is doing this
shriman_deepak
#include<stdio.h> int main () { int Principle; int Time; float Rate ; printf("Enter the value of Principal \n"); scanf("%d", Principle); printf("Enter Time Duration \n"); scanf("%d",Time); printf("Enter the Rate of Interest \n" ); scanf("%f", Rate); printf("Simple Interestn =%f", (Principle*Time*Rate)/100 ); return 0; }
shriman_deepak
There is something wrong, please help me out
shriman_deepak
You forgot &
oh yes i am so dumb, but after putting it is still not working
shriman_deepak
What's the error?
sorry i forget to save and run,
shriman_deepak
thankyou
shriman_deepak
By the wat how can i modify this code to make it short ?
Anonymous
By the wat how can i modify this code to make it short ?
take the inputs on a single line maybe
shriman_deepak
or it is already short ?
shriman_deepak
Anonymous
or it is already short ?
it is already short
Anonymous
it will work ?
yes scanf("%d %d %f", ...)
Anonymous
the spaces in between will consume as many whitespace characters as possible
Anonymous
so even if someone enters on 3 separate lines, the scan will work
shriman_deepak
Enter the value of Principal 1000 Enter Time Duration 3 Enter the Rate of Interest 12 Simple Interestn =360.000000
Prince kumar
Write a C++ program to input two numbers and check whether they are twin prime numbers or not. Hint: Twin prime numbers are the prime numbers whose difference is 2. For example: (5,7), (11,13), ....... and so on.
Prince kumar
Can anyone solve this
alltheCats
I am getting segmentation fault during compiling cpp program
alltheCats
I am getting segmentation fault during compiling cpp program
What is segmentation fault? And how can I fix this?
abababbaba
Write a C++ program to input two numbers and check whether they are twin prime numbers or not. Hint: Twin prime numbers are the prime numbers whose difference is 2. For example: (5,7), (11,13), ....... and so on.
#include<upstream> Using namespace std; int main(){ int n,m; cin>>n>>m; if(n-m==2){ cout<<"twin prime number"; }else if(m-n==2){ cout<<"twin prime number"; }else{ cout<<"not twin prime number"; } return 0; }
Prince kumar
iostream
Thanku bro
V.C.
What is segmentation fault? And how can I fix this?
https://en.m.wikipedia.org/wiki/Segmentation_fault
Prince kumar
Using the switch statement, write a menu driven program in C++ (i) To check and display whether a number input by the user is a composite number or not (A number is said to be a composite, if it has one or more than one factors excluding 1 and the number itself). Example: 4, 6, 8, 9…
Alishba
Can somebody tell why this code is causing error
Alishba
The pointer assignment is correct according to my knowledge
Alishba
This code is incomplete
Alishba
I commented some parts out so that it is easier for anyone of you to detect the issue
Captain
I don't know the error but always deallocate the heap memory after the usage.
Mazen
One of the best training courses on YouTube about C language https://youtube.com/playlist?list=PLo80fWiInSIM9bqj3mh-lSpMWqyn9Euo3
oreZ
Can someone help me how to make vectors in any dimension the user inputs The code should read the dimension number of the vectors (size) and also the coordinates that define the vector. The output must be the angle between two vectors for any dimension number
Engr.
Please more explain about iostream
olli
Please more explain about iostream
https://en.cppreference.com/w/cpp/header/iostream
RANGER
can ask about visual studio?
Anonymous
Thank you
Anshul
set<pair<int,int>> s; s.insert(make_pair(10,1)); s.insert(make_pair(10,3)); s.insert(make_pair(20,3)); s.insert(make_pair(30,3)); auto it=s.find(make_pair(10,4)); s.erase(it); for(auto x:s) { cout<<x.first<<" "<<x.second<<endl; }
Anshul
in this code as 10,4 is not there in the set then why it deletes some elements
Anshul
the output i get is 10,1 and 20,3
RANGER
Yup
i have a c# project..when i open it using visual studio.it said project was unloaded
Anonymous
the output i get is 10,1 and 20,3
This is because your program exhibits Undefined Behavior. You are trying to erase an element that does not exist.