32 Answers
New Answer32 Answers
New AnswerNoel Widler its ok, if it would be homeworks, if i could i would help, but as i see, you have help enough 👍😉
#include<iostream> #include<conio.h> void main() { clrscr(); int i1, i2, i3, i4; i1 = 234 , i2 = 360, i3 = 796, i4 = 1344; float fl1, fl2, fl3, fl4; fl1 = 34.5, fl2 = 7.12, fl3 = 112.12, fl4 = 3.14; char ch1, ch2, ch3, ch4; ch1 = '#', ch2 = '@', ch3 = '>', ch4 = '|'; cout<<"Integers: "<<i1<<" "<<i2<<" "<<i3<<" "<<i4<<endl; cout<<"Floats: "<<fl1<<" "<<fl2<<" "<<fl3<<" "<<fl4<<endl; cout<<"Characters: "<<ch1<<" "<<ch2<<" "<<ch3<<" "<<ch4<<endl; cout<<"We have Displayed the text in 4 lines Using [ cout<< ] statment"; getch(); }
#include<iostream.h> #include<conio.h> void main() { clrscr(); char S='SoloLearn'; int i=100; float f=3.14; cout<<"Hello World"<<endl; cout<<"Character Value: "<<S<<endl; cout<<"Integer Value: "<<i<<endl; cout<<"Floating Point Value: "<<f<<endl; getch(); }
#include <iostream> int main() { std::cout << R"(characters 1 2 3 1.5 2.3 7.98022)"; }
Abhi Varshini <iostream> should be written without the .h extension. And neither do you use conio nor is it part of the official language standard. Apart from that, good example.
The location of an error is shown with a line:column pair, at least with this compiler. 4:11 led to "int main" instead of "void main". Your main must return int. 6:11 You forgot "=". 9:1 You forgot a ";". 13:1 Don't use "getch". Tanay just left it away.
tooselfish If it's really homework and he keeps on doing that, one day, noone's going to help him and he'll get an F.
//copy and paste #include <iostream> using namespace std; int main() { int marks = 57; float avg =32.3; char grade='A'; cout<<"I am Widler Noel;"<<endl; cout<<"My total Marks are;"<<marks<<endl; cout<<"My average is;"<<avg<<endl; cout<<"My grade is;"<<grade; }
his my code let me know what i did wrong: #include <iostream> using namespace std; void main() { int marks = 57; float avg =32.3; char grade='A'; cout<<"I am Widler Noel;"<<endl; cout<<"My total Marks are;"<<marks<<endl; cout<<"My average is;"<<avg<<endl; cout<<"My grade is;"<<grade; getch(); }
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message