1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Oliga [24]
4 years ago
13

How can I print an int as a char in C?

Computers and Technology
2 answers:
Nadusha1986 [10]4 years ago
7 0
Convert it to a char and print it
Luba_88 [7]4 years ago
7 0
Use a char format specifier instead of an integer format specifier. C will automatically print the integer as a character, e.g. 97 will print as 'a'.
You might be interested in
Which branch of study can help Jessica study the concept of light
Fiesta28 [93]

Answer:

Physics, Quantum Mechanics

Explanation:

Light is a stream of photons with no weight. If you want to dig deeper in this mysterious phenomena, you should study physics and quantum mechanics. Physics takes up things like the theory of relativity, which can be useful in studying spacetime and how light travels through it, and quantum mechanics, being the study of matter in an atomic level, should help you get an understanding on how photons of light travel and why they behave so strangely.

4 0
3 years ago
Which type of bank account typically offers no iterest?
SCORPION-xisa [38]
Money market?? i think anyway.
8 0
3 years ago
Read 2 more answers
A personal phone directory contains room for first names and phone numbers for 30 people. Assign names and phone numbers for the
Fynjy0 [20]

Answer:

# include <iostream.h>

# include <stdio.h>

# include <string.h>

using namespace std;

class citizen

{      

    int i;

    public string name[30];

    public long int phonenumber[30];

    public void addindividual(string name1)

     {      

           If (i<=30)

            {     int flag=0;

                  for(int j=0; j<=i;j++)

                  {

                     if (strcmp(name[i], name1)

                      {

                          flag=1;

                      }

                     else

                     {  

                           flag=0;

                     }

                  }

                  If (flag)

                 {

                  if (i<30)

                  {

                  for(j=i+1;j<=30; j++)

                  {

                        cout<<"Enter the name:"; getchar(name[j]);

                        cout<<"Enter the phone number:"; cin>>phonenumber[j];

                         i++;

                   }

                  else  

                   {

                        cout<<"The person already exists";

                        exit();

                   }

              }

            else

             {

                 cout<<"array is full:";

                 exit();

             }

     }

}

Void main()

{

     string str;

    cout<<" Enter name:";

    getline(cin, str); ;

     citizen c1=new citizen();

     c1.addindividual(name1);

}

Explanation:

With a little more effort you can make the program allow the user to enter any number of details, but less than 30 overall. We have used here flag, and as a programmer we know why we use the Flag. It is used to check whether certain Boolean condition is fulfilled or not. Here, we are checking whether a given name is present in the array of names, and if it is not present, we add that to the list. And if the name is present, we print, it already exist.

4 0
3 years ago
What does Digital Citizenship mean to you?
Nikolay [14]
A digital citizen refers to a person who has the knowledge and skills to effectively use digital technologies to communicate with others, participate in society and create and consume digital content. Digital citizenship is about confident and positive engagement with digital technologies. Digital citizenship refers to responsible technology usage, and teaching digital citizenship is essential to helping students achieve and understand digital literacy, as well as ensuring cyberbullying prevention, online safety, digital responsibility, and digital health and wellness.
5 0
3 years ago
The function below tries to create a list of integers by reading them from a file. The file is expected to have a single integer
Setler [38]

Answer:

Check the explanation

Explanation:

def get_list_of_integers_from_file(filename):

int_list=[]

for line in open(filename).readlines():

try:

int_list.append(int(line))

except:

continue

return int_list

print(get_list_of_integers_from_file('file.txt'))

 

File.txt:

Kindly check the output below.

4 0
3 years ago
Other questions:
  • What kind of software program delivers advertising content in a manner that is unexpected and unwanted by the user, and is typic
    14·1 answer
  • The class attribute
    8·1 answer
  • Run a Monte Carlo simulation on this vector representing the countries of the 8 runners in this race:
    7·1 answer
  • Help me please I will make BRAINLIEST
    5·1 answer
  • List three types of Software:
    15·1 answer
  • Which information can you apply to every page of your document with the page layout options?
    9·1 answer
  • Can rank u r guys in rocket leagye
    13·1 answer
  • Complete the sentence.
    10·1 answer
  • I'm pretty sure most of you know squid game, right? Well, are the actors really dying? or is it just CGI or effects? Because it'
    5·2 answers
  • NO LINKS Please
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!