Dev C++
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Ispis unete reci kao odraz u ogledalu sa okvirom od ***

Go down

Ispis unete reci kao odraz u ogledalu sa okvirom od *** Empty Ispis unete reci kao odraz u ogledalu sa okvirom od ***

Post  Don Corleone Wed Apr 13, 2011 11:28 pm


#include<stdio.h>
#include<conio.h>
#include<string.h>

//Program za pisanje neke unete reci kao odraza u ogledalu sa okvirom od zvezdica
// primer:
/*
***************
* Pera | areP *
***************

*/

void ogledaloZvezdica(char locRec[50]){

for (int k=0;k<2*strlen(locRec)+7;k++)
{
printf("*");
}
printf("\n");
printf("* ");
for (int i=0;i<strlen(locRec);i++)
{
printf("%c",locRec[i]);
}
printf(" | ");
for (int j=strlen(locRec)-1;j>=0;j--)
{
printf("%c",locRec[j]);
}
printf(" *\n");
for (int l=0;l<2*strlen(locRec)+7;l++)
{
printf("*");
}
}

int main(){
char rec[50];

printf("Ispis reci kao odraz u ogledalu \n\n");
printf("Unesite neku rec \n");
printf("rec=");scanf("%s",&rec);printf("\n\n");

ogledaloZvezdica(rec);
getch();

}
Don Corleone
Don Corleone
Admin

Posts : 148
Join date : 2009-10-28
Age : 31
Location : Sombor - Serbia

https://programing.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum