اذهب إلى المحتوى
  • 0

برنامج لطباعة نجوم باستخدام لغة ++C

محمد زين الدين

السؤال

Recommended Posts

  • 0

مرحباً محمد إليك الكود بلغة جافاسكربت 
 

for(let i =0; i <5; i++ ) {
  for(let j=0; j < 4; j++) {
    if(i === 2 ) {
      document.write('*')
    } else {
      if(j === 1 || j === 2) {
        document.write('&nbsp;&nbsp;');
      } else {
        document.write('*')
      }
    }
    
  }
  document.write('<br />');
}

هذا هو  الكود 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

  • 0
بتاريخ الآن قال Mohammed Saber:

مرحباً محمد إليك الكود بلغة جافاسكربت 
 


for(let i =0; i <5; i++ ) {
  for(let j=0; j < 4; j++) {
    if(i === 2 ) {
      document.write('*')
    } else {
      if(j === 1 || j === 2) {
        document.write('&nbsp;&nbsp;');
      } else {
        document.write('*')
      }
    }
    
  }
  document.write('<br />');
}

هذا هو  الكود 

اشكرك صديقي لكن اوريده على ++ c

 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

  • 0
بتاريخ 11 دقائق مضت قال محمد زين الدين:

اشكرك صديقي لكن اوريده على ++ c

 

/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

void starPattern() 
{ 

    for (int i = 0; i < 5; i++) { 
  
        for (int j = 0; j < 4; j++) {
            if(i == 2 ) {
              cout << "*";
            } else {
              if(j == 1 || j == 2) {
                cout << " ";
              } else {
                cout << "*";
              }
            }
        } 
  
        // Ending line after each row 
        cout << endl; 
    } 
}

int main() 
{ 

    starPattern(); 
    return 0; 
} 

 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

  • 0
بتاريخ الآن قال Mohammed Saber:

/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

void starPattern() 
{ 

    for (int i = 0; i < 5; i++) { 
  
        for (int j = 0; j < 4; j++) {
            if(i == 2 ) {
              cout << "*";
            } else {
              if(j == 1 || j == 2) {
                cout << " ";
              } else {
                cout << "*";
              }
            }
        } 
  
        // Ending line after each row 
        cout << endl; 
    } 
}

int main() 
{ 

    starPattern(); 
    return 0; 
} 

 

شكرا جزيلا غلبتك معي

رابط هذا التعليق
شارك على الشبكات الإجتماعية

انضم إلى النقاش

يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.

زائر
أجب على هذا السؤال...

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   جرى استعادة المحتوى السابق..   امسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

  • إعلانات

  • تابعنا على



×
×
  • أضف...