База ответов ИНТУИТ

Язык программирования C++

<<- Назад к вопросам

Что выведет следующая программа?
#include <iostream>int main() {    int i;    for(i = 0; i < 9; i++)    std::cout << i+1;    return 0;}

(Отметьте один правильный вариант ответа.)

Варианты ответа
цифры от 0 до 8
программа не будет построена из-за ошибок
цифры от 1 до 9(Верный ответ)
Похожие вопросы
Что выведет следующая программа ?
#include <iostream.h>int main() {     int 1_i ;     for( 1_i = 0; 1_i < 9; 1_i++)     cout << 1_i +1;     return 1;}
Результат работы программы:
#include <iostream.h>int main(){int ic; cout << "Введите любую десятичную цифру:"; cin >> ic;switch (ic)   {   case 0: case 1: cout << "один ";   case 2: case 3: cout << "три ";   case 4: case 5: cout << "пять ";   case 6: case 7: cout << "семь ";   case 8: case 9: cout << "девять "; break;   default: cout << "ERROR!!!";   }    return 1;}
Результат работы программы:
#include <iostream.h> int main(){ char A[] = "ABC "; char *U = &A[2]; cout << "\n" << *U--; cout << *U-- ; cout << *U; return 1;}
Что будет выведено на экран в результате выполнения приведенной ниже программы?
#include "iostream.h"#include "conio.h"int main(){  int *a;   int b=7;   a = &b;   b+= 7;  (*a)++;   cout << a;  getch();  return 0;} 
Что будет выведено на экран в результате выполнения приведенной ниже программы:
#include "iostream.h"#include "conio.h"#define N=10int main(){  int x=N;  cout<<x;  getch();  return 0;}	
Что будет на экране после выполнения программы
#include <iostream.h>short x = 4, i = 0;void fun1(){  if (i == 0) throw 2; }int fun2(){ --x; fun1();  x++; return x; }int main(){ try  { fun2(); }     catch (int)  { cout << "Exception "; }  cout << x << " " << i;  }    
Что будет на экране после выполнения программы?
    #include <iostream.h>    #include <fstream.h>    #include <string.h>    int main()      {    int i = 1, j = 25;  double a = 25e6;   char s[40];    strcpy(s, "Test");    ofstream outfile("c:\\test.dat");    if (!outfile)      { cout << "Ошибка создания файла";        return 1;  }    outfile << i << ' ' << j << ' ' << a << ' ' << s << endl;    outfile.close();      }    
Что будет на экране после выполнения программы
#include <iostream.h>short x = 4, i = 0;void fun1(){  if (i == 5) throw 2; }void fun2(){ --x; fun1();  x++; }int main(){ try  { fun2(); }   catch (int)  { cout << "Exception "; }  cout << x << " " << i;}
Какой результат будет у следующего выражения?
    #define CIRC(x) (3 * (x) * (x))    #include <iostream.h>    int main()    {    int a = 1, b = 2;    std::cout << CIRC(a + b);     }    
Что будет на экране после выполнения программы
#include <iostream.h>short x = 4, i = 0;void fun1(){ double p=2;   if (!i) throw p; }void fun2(){ --x; fun1();  x++; }int main(){ try  { fun2(); }    catch (double)   { cout << "Exception "; }  cout << x << " " << i;  }