CS508 Assignment No. 01 Solution and Discussion
-
Java:
public class MyClass { public static void main(String args[]) { System.out.println("My Student ID is BC160401656"); System.out.println("My Language is JAVA"); } }C#:
using System; class Program { static void Main() { Console.Write("My Student is is BC160401656 \n"); Console.Write("My Language is C#"); } }C++:
#include <iostream> using namespace std; int main() { cout"MY Student ID is BC160401656 \n " ; cout"Language is C++" ; } -
Java:
public class MyClass { public static void main(String args[]) { System.out.println("My Student ID is BC160401656"); System.out.println("My Language is JAVA"); } }C#:
using System; class Program { static void Main() { Console.Write("My Student is is BC160401656 \n"); Console.Write("My Language is C#"); } }C++:
#include <iostream> using namespace std; int main() { cout"MY Student ID is BC160401656 \n " ; cout"Language is C++" ; }@cyberian
Please and check and any suggestion?
https://youtu.be/ZPvQdXLF6EI -
-
Idea Solution
https://youtu.be/ZPvQdXLF6EI -
Correct Solution of C++
#include <iostream> using namespace std; int main() { int outerloop=1; int innerloop=1; cout<<"My Student ID is BS12345678\n"; cout<<"My coding Language is C++\n\n"; for(int i=1;i<=29;i++){ cout<<"outerloop:"<<outerloop++; if (outerloop == 30){ cout<<"\n.......\n"; for(int j=1;j<=79;j++){ cout<<"innerloop:"<<innerloop++; } } } } -
public class MyClass { public static void main(String args[]){ System.out.println("My id is BS12345678"); System.out.println("My language is Java"); int outerloop=1; int innerloop=1; for(int i=1;i<=29;i++){ System.out.print("outerloop:" + outerloop++); if (outerloop == 30){ System.out.println("\n----------\n"); for(int j=1;j<=79;j++){ System.out.print("innerloop:" + innerloop++); } } } } } -
using System; class Program { static void Main() { Console.Write("My Student is is BC160401656 \n"); Console.Write("My Language is C#"); int outerloop=1; int innerloop=1; for (int i=1;i<=29;i++){ Console.Write("outerloop:" + outerloop++); if (outerloop == 30){ Console.Write("\n----------\n"); for (int j=1;j<=79;j++){ Console.Write("ïnnerloop:" + innerloop++); } } } } } -
Solution:
Java:public class MyClass { public static void main(String args[]) { System.out.println("My id is BC180401429"); System.out.println("** Language is JAVA **"); for(int i=0;i<=14;i++){ for(int j=0;j<=29;j++){ System.out.print("Outer:"+i+"Inner:"+j); } } } }
C#:
using System; class Program { static void Main() { Console.WriteLine("My id is BC180401429"); Console.WriteLine("** Language is C# **"); for(int i=0;i<=14;i++){ for(int j=0;j<=29;j++){ Console.Write("Outer:"+i+"Inner:"+j); } } } }
C++:
#include <iostream> using namespace std; int main() { cout<< "My id is BC180401429 \n"; cout<< "** Language is C++ ** \n"; for(int i=0;i<=14;i++){ for(int j=0;j<=29;j++){ cout<< "Outer:"<<i<<"Inner:"<<j; } } }
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login








