الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

[مخالف]اسئلة - ارجو المساعدة

مغلق
بدأه aem2013 في 13 أبريل 2012 · 3 رد · 276 مشاهدة · في ارشيف قسم C/C++
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

ارجو المساعدة لحل الاسئلة التالية انا طالب جامعي مبتدئ

write aplogram to

1- che de whetht a givan number is odd or eveu

2- To che de whethe a number is multiple of .

3- accapt number and print name of the daj in the week using switdn

(0= = 2 %x )

------------------------------------------------------------------------------

سؤالين\

1- write c++ code to calculate the square & cube of a given number .

2- write c++ code to calculate the average of three markes of student .

تكفون الجواب يااخوان لدي اختبار يوم الاحد وجزاكم الله خير

#2

1- che de whetht a givan number is odd or eveu

#include <stdio.h>
#include <conio.h>
int main(int argc, char *argv[])
{
    int number;
    printf("Enter number = ");
    scanf("%d", &number);
    if(number%2)
     printf("number %d is odd.\n", number);
    else
     printf("number %d is even.\n", number);
    getch();
    return 0;
}

2- To che de whethe a number is multiple of .

#include <stdio.h>
#include <conio.h>
int main(int argc, char *argv[])
{
    int number1, number2;
    printf("Enter number 1 = ");
    scanf("%d", &number1);
    printf("Enter number 2 = ");
    scanf("%d", &number2);
    if(number2%number1)
     printf("%d is not multiple of %d.\n", number2,number1);
    else
     printf("%d is multiple of %d.\n", number2,number1);
    getch();
    return 0;
}

3- accapt number and print name of the daj in the week using switdn

#include <stdio.h>
#include <conio.h>
int main(int argc, char *argv[])
{
    int number;
    printf("Enter number = ");
    scanf("%d", &number);
    switch(number){
     case 1:printf("Sunday.");break;
     case 2:printf("Monday.");break;
     case 3:printf("Tuesday.");break;
     case 4:printf("Wednesday.");break;
     case 5:printf("Thursday.");break;
     case 6:printf("Friday.");break;
     case 7:printf("Saturday.");break;
     default:printf("Error.");
    }
    getch();
    return 0;
}

4- write c++ code to calculate the square & cube of a given number .

#include <stdio.h>
#include <conio.h>
int main(int argc, char *argv[])
{
    float number;
    printf("Enter number = ");
    scanf("%f", &number);
    printf("Square of %f = %f", number, number*number);
    printf("\nCube of %f = %f", number, number*number*number);
    getch();
    return 0;
}

5- write c++ code to calculate the average of three markes of student

#include <stdio.h>
#include <conio.h>
int main(int argc, char *argv[])
{
    float mark, marksSum = 0;
    int i;
    for(i = 0; i < 3; i++){
          printf("Enter mark of student %d = ", i+1);
          scanf("%f", &mark);
          marksSum += mark;
    }
    printf("Average of marks = %.2f", marksSum / 3);
    getch();
    return 0;
}

تم تعديل هذه المشاركة بواسطة khatibe_30 في 13 أبريل 2012 في 12:22

1

[سبحان الله و بحمده, سبحان الله العظيم]

#3

الف الف شكر اخوي khatibe_30 ماقصرت جزيت خيرا :) ......... ياليت تترجم لي الاسئلة جزاك الله خير

#4

الأخ الكريم/الأخت الكريمة

السلام عليكم ورحمة الله وبركاته

مرحباً بكم في منتدى الفريق العربي للبرمجة

تأسف إدارة المنتدى لغلق الموضوع وذلك لمخالفته قوانين المشاركات .

قواعد طرح المشاركات

/index.php?showtopic=29343

شاكرين لكم حُسن تعاونكم

{username}

1

مدونتي: C++ Tips and Tricks

هذا الموضوع مغلق.

مواضيع مشابهة