adhikarimanoj1
BAN USER
#include <stdio.h>
#include <stdlib.h>
int main (){
int ht = 5;
int n,i ;
for(n = 0; n<=ht; n++){
for (i = 0; i<n ;i++){
printf("*");
}
if (n!= 0)
printf(" \n");
}
return 0;
}
Something like this, bit long can be done optimally using for loop:::
int main ()
{
float return_val;
float cost = 20.5;
float cash = 91;
float quat = 0.25;
float under_dollar;
int num_twenty, num_ten,num_five,num_one,num_quarter;
if (cash<cost){
printf("pay: %f", cost);
}
else {
return_val = cash-cost;
while(return_val != 0)
{
num_twenty = return_val/20;
printf("number of 20 %d \n",num_twenty);
return_val = return_val-num_twenty*20;
if (return_val/10 !=0){
num_ten = return_val/10;
return_val = return_val-num_ten*10;
printf("number of 10 %d\n",num_ten);
}
if(return_val/5 !=0){
num_five = return_val/5;
return_val = return_val - num_five*5;
printf("number of 5 %d\n",num_five);
}
if(return_val/1 !=0){
num_one = return_val;
return_val = return_val - num_one;
printf("number of 1 %d\n",num_one);
}
//printf("remaineder %f\n",return_val);
if(return_val/quat !=0){
num_quarter = return_val/quat;
return_val = return_val - num_quarter*0.25;
printf("number of quaters %d\n",num_quarter);
}
return_val = 0;
}
}
return 0;
}
Repkylieblindner, abc at ASAPInfosystemsPvtLtd
Hello, I am Kylie. I am working in a store as Supply chain managers promote the design, development, and implementation ...
Repjoewfeder, Apple Phone Number available 24/7 for our Customers at ADP
I am a Golf course architect in PriceRite Warehouse Club company. I am a positive person and a sense of ...
RepRussBDycus, Android test engineer at ABC TECH SUPPORT
I am working as a manager in Lionel Kiddie City company. I really enjoy my job. I like to play ...
Repjohndbutler0, Aghori Mahakal Tantrik at BMO Harris Bank
I consider myself to be driven, proactive, hard working, a team player, creative and absolutely passionate person! I am strong ...
Reppaynealiciam, Apple Phone Number available 24/7 for our Customers at Adap.tv
Hello I am Sarah Cote, and I live in Missouri, USA. Last year, Web trailblazer. Passionate entrepreneur. Subtly charming bacon ...
Repvickiwgerber, Member Technical Staff at Boomerang Commerce
I am Vicki From San Antonio USA, I am working as an Interior decorator in Golden Joy company. I have ...
Repsuejnagel, Virus Researcher at Email Customer Service
Hello, I am Sue . I am a chief information officer at Vernon. I am responsible for providing the global communications ...
Repjunehudson, Associate at Advisory Board Company
I am passionate about fashion and love to explore black magic to take revenge.Being a fashion designer involves more ...
Rephollymclark8, Apple Phone Number available 24/7 for our Customers at Accenture
I am clinical laboratory technologist in Stratapro company. I have Excellent clinical laboratory skills, with commended performance conducting/analyzing laboratory ...
Repkathimhoke, Product Security Engineer at Argus
Hi, I am Kathi from Mineola. I am working as an Identification clerk in a Tradewell company. I spent over ...
int state,result;
- adhikarimanoj1 June 26, 2011int num = 97;
int i;
for ( i = 2; i<num; i++){
result = num%i;
if (result ==0)
state = 0;
}
if (state !=0)
printf("this is prime ");
if (state ==0)
printf("this is not prime ");