Function can be used in C

Asked By 0 points N/A Posted on -
qa-featured

I would like to ask what kind of function I should use on C programming to print name?

SHARE
Best Answer by Kanhai Else
Best Answer
Best Answer
Answered By 0 points N/A #101888

Function can be used in C

qa-featured

C programs require function calls to library functions to print anything on the screen as the output of the program. It requires connecting the iostream.h for the purpose. Mostly we use the header file "stdio.h" 

#include<stdio.h>

To call a set of library functions for the standard input and output. These beginning the program with the above line, call the printf () function from the main () or any other function to direct the a sequence of characters to a standard output. Try the following.

int main(){

printf("My name is XYZ");

return(0);

}

Thus you get an output 

My name is XYZ.

The syntax of printf function is given below.

printf("sequence of characters & %format specifiers", parameters);

Parameters and format specifiers are optional. We have just specified the sequence of characters in the above program.

Answered By 20 points N/A #101887

Function can be used in C

qa-featured

Hey carson!

C is a programming Language with lots of functions in it. There are two methods with which you can print your name in C Programming Language.

The first method is a simple method. You can use the following function to print your name:

void main() {

printf("Your namen");

}

Second method is to print your name without semicolon. For this purpose use the following:

  if(printf("Your name."))

{}

I will recommend you a website which will help you to learn more about C Language. You can use https://www.cprogramming.com/ for your help. It is a free site.

Hope it can help you.

Thanks

Tunacao Caaron

Answered By 0 points N/A #101889

Function can be used in C

qa-featured

Dear kanhai.

Thank you so much for that. Techyv is really a good source of information especially for students.

They could have a lot of things to learn here.

Thank you.

Related Questions