8escs01 problem solving through programming unit-2: c programming basics


MANAGING INPUT & OUTPUT OPERATIONS



Download 0,98 Mb.
bet17/22
Sana19.05.2023
Hajmi0,98 Mb.
#940862
1   ...   14   15   16   17   18   19   20   21   22
Bog'liq
Module 2 c program

MANAGING INPUT & OUTPUT OPERATIONS


72
UNFORMATTED OUTPUT FUNCTIONS
(c) puts( ) function:
  • puts displays a single / paragraph of text to the standard output device.
  • Syntax: puts(variable_name);
  • Example: #include #include

Output:

void main( )
{
char a[20];

Abcd Abcd

efgh efgh

gets(a);

puts(a);

getch( );

}

Example Program


/*A program to read a character from keyboard and then prints it in reverse case*/
/*This program uses three new functions: islower,toupper,and tolower.
#include
#include main()
{
char alphabet; printf(“Enter an alphabet”); putchar(‘\n’);
alphabet = ghetchar(); if(islower(alphabet)) putchar(toupper(alphabet)); else putchar(tolower(alphabet));
}
73
Output:
Enter An alphabet a
A
Enter An alphabet Q
q
Enter An alphabet z
Z

DECISION MAKING & BRANCHING

CONTROL STATEMENTS

  • Control Statement are program statements that are cause a jump of control from one part of program to another part of program
  • These statements are classified into two types:
    • Branching Statements
    • Looping Statements

CONTROL STATEMENTS


BRANCHING STATEMENTS
  • In decision making statements, group of statements are executed when condition is true. If condition is false, then else part statements are executed.
  • There are 3 types of decision making control statements in C language. They are:
    • if statements
    • ifelse statements
    • nested if statements
    • elseif statements
    • Switch statements

Download 0,98 Mb.

Do'stlaringiz bilan baham:
1   ...   14   15   16   17   18   19   20   21   22




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish