JHUICY
I'm waiting
Roshan
#include <iostream> using namespace std; int main() { int m=12; int n=24; int p=6; int q=3; int r=2; int s=4; int t=1; int d=12/6; //division int e=6-3; //subtract int a=6+3; //addition string tr= "true"; string fa= "false"; if ((m > p)&&(q > s)&&(r > t)) cout <<" The boolean expressions is: "<< tr; else cout <<" The boolean expressions is: "<< fa; cout << "\n"; cout << "\n"; if ((m > n*p) || (q*r < p) || (p > s+t)) cout <<" The boolean expressions is: "<<tr; else cout <<" The boolean expressions is: " <<fa; cout << "\n"; cout << "\n"; if ((d == r) && (e == r) || (a == 2*s)) cout <<" The boolean expressions is: "<< tr; else cout <<" The boolean expressions is: "<< fa; cout << "\n"; cout << "\n"; return 0; }
Roshan
I've not simplified it BTW, do it on your own. The output is correct
JHUICY
simplified like how?
Roshan
simplified like how?
Check for smaller details
JHUICY
please can you comec to pm
JHUICY
come*
JHUICY
i would like to ask you something please
christian
printf("Enter the 5 digit number"); int num; scanf("%d", num); int n1=num%10; int n2=num-n1; int n3=n2%10; int n4=n2-n3; int n5=n4%10; int n6=n4-n5; int n7=n6%10; int n8=n6-n7; int n9=n8%10; int sum=n1+n3+n5+n7+n9; printf(" The sum of the digits is %d", sum);
If your code was to find the sum of the digits of a number Below is the correct code include <stdio.h> int main() { //define the variables user input, sum and the remainder //read the user input first of all //make sure sum is initialised to 0 int num, sum = 0, rem; printf("Enter the 5 digit number"); scanf("%d", &num); while(num > 0) { //get the remainder of num divided by 10 and add it to the sum //divide num by 10 rem = num % 10; sum = sum + rem; num = num / 10; //all this is when the number isnt zero } //print the result printf(" The sum of the digits is %d", sum); }
JHUICY
2. Write a C++ program that accepts a number followed by one space and then a letter. If the letter following the number is an f, the program should treat the number entered as a temperature in degrees Fahrenheit, convert the number to the equivalent degrees Celsius, and print a suitable display message. If the letter following the number is a c, the program should treat the number entered as a temperature in Celsius, convert the number to the equivalent degrees Fahrenheit, and print a suitable display message. If the letter is neither an f or c, the program should print a message that the data entered is incorrect and then terminate. Use an if-else chain in your program and make use of the conversion formulas: Celsius = (5.0/9.0) *(Fahrenheit – 32.0) Fahrenheit = (9.0/5.0) * Celsius + 32.0)
JHUICY
And this is the answer please check if it's correct
JHUICY
#include <iostream> #include <conio.h> using namespace std; int main() { float number,Celcuis,Fahrenheit; char c;// variable to enter a letter. cout << "\n"; cout << "\t\t\t\tTEMPERATURE CONVERTOR IN DEGREE CELSUIS(c) AND Fahrenheit(f)"; cout << "\t\t\t\t\t\t\t************************************************************"; cout << "\n"; cout << "\t\tEnter a number: "; cin >> number; cout << "\n"; cout << "\t\tEnter a letter(f or c): "; cin >> c; if (c=='f'){ Celcuis=((5.0/9.0)*(number-32.0)); cout << "\nThe temperature after converting into degree Celsuis is: "<< Celcuis; } else if (c=='c'){ Fahrenheit=((9.0/5.0)* number+32.0); cout <<"\nThe temperature after converting into degree Fahrenheit is: "<< Fahrenheit; } else cout << "\nIncorrect input, Please enter a (f or c) "; cout << "\n"; return 0; }
christian
gotcha..thanks
Welcome bro
Shazam
Guysss let's start 60DaysCP with global community
Anonymous
I C usable to mobile devices?
Anonymous
I mean is there a compiler for IOS and/or Android?
Anonymous
I have programmed using arduino. It is quite interesting.
Anonymous
It has a interface to program it using C.
Al
sorry what was the command here to find a list of C books?
Anonymous
You got me wrong, what I am looking for is a development environment to develop mobile software using C/C++
Anonymous
It should result as a apk on Android if I am not wrong and in IOS I am not sure.
Pavel
+1 for Qt
Pavel
There are ways to do that with Android NDK and (what people use for ios), but that's a lot of time to spend
Al
Ios
Al
/get c books
Al
/get cbooks
Pavel
You mean Java is the shortest path to develop mobile apps?
Well, do the design in Java and connect all the logic as a C++ library
Suka
Pavel
You mean Java is the shortest path to develop mobile apps?
But what I said that's not the shortest path. That's one possible path. The shortest that I know is using Qt.
Anonymous
Anonymous
It is easier to program in Java and you have automated memory garbage collector
klimi
C is much faster than Java
(depends on user case)
Anonymous
C is much faster than Java
1) Qt is not Java 2) in 99% you can tell the difference between Java and C++ in client apps
Anonymous
(depends on user case)
Compare counter strike 1.6 and Minecraft
klimi
i would agree with minecraft and minetest, but honestly... counter strike 1.6 is totally different genre than minecraft, minecraft has to calculate a lot more things that cs
Pavel
Compare counter strike 1.6 and Minecraft
I don't know what you're trying to say, nobody forces you to write in Java
Anonymous
Compare counter strike 1.6 and Minecraft
> talking about mobile apps > Comparing games Are you sane?
Anonymous
I don't know what you're trying to say, nobody forces you to write in Java
I know, I only knew Java for many years it was the only programming language I knew well
Anonymous
Stop talking about Java
Anonymous
> talking about mobile apps > Comparing games Are you sane?
What’s the difference? It’s all processes and files for the operating system. It could be a good academic monography comparing programming languages.
Anonymous
Mine was about VPN
Anonymous
I am
Where did you graduate?
Anonymous
Where did you graduate?
1) Am I at an interrogation? 2) it's offtop
Anonymous
The question is: is C suitable for mobile apps?
Anonymous
No
Why?
ברני
The question is: is C suitable for mobile apps?
You can do anything with C if you download more apps on the sides, C alone can't.
Suka
No
+1
Nomid Íkorni-Sciurus
You can do anything with C if you download more apps on the sides, C alone can't.
Well- technically you could produce NDK apps, but if he's asking, it's safe to assume it's not his case.
Anonymous
You can do anything with C if you download more apps on the sides, C alone can't.
I suppose you are referring to C libraries made for operating systems such as IOS and Android?
Nomid Íkorni-Sciurus
If there are any
there are, but you don't need them 99% of the time.
Anonymous
I am going to do post graduation in mobile development in the future
Anonymous
Why?
Because it's too low level for them
Nomid Íkorni-Sciurus
I am going to do post graduation in mobile development in the future
Do you need to do any GPU-related stuff, deal with SDL contexts or the Linux kernel or daemons?
Anonymous
Managing resources by hand reduces overhead of course But again the mobile apps is not the environment you can notice the overhead in 99% cases
Nomid Íkorni-Sciurus
Nomid Íkorni-Sciurus
Anonymous
Native APIs for Android and iOS doesn't support C or C++ for making GUI also
Nomid Íkorni-Sciurus
Anonymous
LLVM
It's AoT Compiler, not JIT
Nomid Íkorni-Sciurus
Anonymous
Obj-C and Swift compile to native ARM/x86 code
Anonymous
You cannot run JIT in iOS anyway because of some Apple restrictions
Nomid Íkorni-Sciurus
hm, I see.